File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
test/ex_doc/formatter/epub Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 22
22
</section>
23
23
<% end %>
24
24
25
- <%= for group <- dbg( summary) , key = text_to_id(group.title) do %>
25
+ <%= for group <- summary, key = text_to_id(group.title) do %>
26
26
<section id="<%= key %>" class="details-list">
27
27
<h1 class="section-heading"><%=h to_string(group.title) %></h1>
28
28
<%= if doc = group.doc do %>
Original file line number Diff line number Diff line change 51
51
</a>
52
52
<span class="text"><%= group.title %></span>
53
53
</h1>
54
- <%= if doc = group.rendered_doc do %>
54
+ <%= if doc = group.doc do %>
55
55
<div class="group-description" id="group-description-<%= key %>">
56
56
<%= render_doc(doc) %>
57
57
</div>
Original file line number Diff line number Diff line change @@ -322,8 +322,13 @@ defmodule ExDoc.Retriever do
322
322
323
323
doc_ast =
324
324
case description do
325
- nil -> nil
326
- text -> doc_ast ( "text/markdown" , % { "en" => text } , [ ] )
325
+ nil ->
326
+ nil
327
+
328
+ text ->
329
+ doc_ast = doc_ast ( "text/markdown" , % { "en" => text } , [ ] )
330
+ sub_id = ExDoc.Utils . text_to_id ( group . title )
331
+ normalize_doc_ast ( doc_ast , "group-#{ sub_id } -" )
327
332
end
328
333
329
334
% ExDoc.DocGroupNode {
Original file line number Diff line number Diff line change @@ -169,9 +169,6 @@ defmodule ExDoc.Formatter.EPUB.TemplatesTest do
169
169
170
170
doc = LazyHTML . from_document ( content )
171
171
172
- IO . warn ( "remove file.write" )
173
- File . write ( "/tmp/doc.html" , LazyHTML . to_html ( doc ) )
174
-
175
172
assert Enum . count ( doc [ "div.group-description" ] ) == 1
176
173
assert Enum . count ( doc [ "#group-description-example-functions" ] ) == 1
177
174
assert Enum . count ( doc [ "#group-description-example-functions h3" ] ) == 1
@@ -180,7 +177,9 @@ defmodule ExDoc.Formatter.EPUB.TemplatesTest do
180
177
assert Enum . count ( doc [ "#example-functions .group-description a[href='#example/2']" ] ) == 1
181
178
assert Enum . count ( doc [ "#example-functions .group-description a[href='#flatten/1']" ] ) == 1
182
179
183
- assert content =~ ~s[ <span class="text">A section heading example</span>]
180
+ assert content =~
181
+ ~s[ <h3 id="group-example-functions-a-section-heading-example">A section heading example</h3>]
182
+
184
183
assert content =~ "<p>A content example.</p>"
185
184
end
186
185
You can’t perform that action at this time.
0 commit comments