File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,20 @@ defmodule ExDoc.Formatter.EPUB.TemplatesTest do
105105 assert content =~ ~r{ <h1 id="content">\s *XPTOModule\s *}
106106 end
107107
108+ test "adds word break to titles" do
109+ module_node = % ExDoc.ModuleNode {
110+ module: XPTO.NestedModule ,
111+ doc: nil ,
112+ id: "XPTO.NestedModule" ,
113+ title: "XPTO.NestedModule"
114+ }
115+
116+ content = Templates . module_template ( formatter_config ( ) , module_node )
117+
118+ assert content =~ ~r{ <title>XPTO.NestedModule [^<]*</title>}
119+ assert content =~ ~r{ <h1 id="content">\s *XPTO.<wbr>NestedModule\s *}
120+ end
121+
108122 test "outputs the functions and docstrings" do
109123 content = get_module_template ( [ CompiledWithDocs ] )
110124
@@ -196,11 +210,6 @@ defmodule ExDoc.Formatter.EPUB.TemplatesTest do
196210 ~r{ <div class="summary-signature">\s *<a href="#example_1/0" data-no-tooltip="" translate="no">}
197211 end
198212
199- test "contains links to summary sections when those exist" do
200- content = get_module_template ( [ CompiledWithDocs , CompiledWithDocs.Nested ] )
201- refute content =~ ~r{ types_details}
202- end
203-
204213 ## BEHAVIOURS
205214
206215 test "outputs behavior and callbacks" do
Original file line number Diff line number Diff line change @@ -495,6 +495,12 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do
495495 ~r{ <h3 id="example_with_h3/0-examples" class="section-heading">.*<a href="#example_with_h3/0-examples" class="hover-link">.*<i class="ri-link-m" aria-hidden="true"></i>.*</a>.*<span class="text">Examples</span>.*</h3>} ms
496496 end
497497
498+ test "add word breaks to title" , context do
499+ content = get_module_template ( [ CompiledWithDocs.Nested ] , context )
500+
501+ assert content =~ "CompiledWithDocs.<wbr>Nested"
502+ end
503+
498504 test "do not output overlapping functions, causing duplicate IDs" , context do
499505 content = get_module_template ( [ OverlappingDefaults ] , context )
500506
You can’t perform that action at this time.
0 commit comments