Skip to content

Commit 6c3a809

Browse files
committed
clean up
1 parent eb3fbe9 commit 6c3a809

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

lib/ex_doc/formatter/markdown/templates.ex

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,13 @@ defmodule ExDoc.Formatter.MARKDOWN.Templates do
4141
"""
4242
@spec synopsis(String.t()) :: String.t()
4343
@spec synopsis(nil) :: nil
44-
def synopsis(nil), do: nil
45-
4644
def synopsis(doc) when is_binary(doc) do
47-
doc =
48-
case :binary.split(doc, "</p>") do
49-
[left, _] -> String.trim_trailing(left, ": ")
50-
[all] -> all
51-
end
52-
53-
# Remove any anchors found in synopsis.
54-
# Old Erlang docs placed anchors at the top of the documentation
55-
# for links. Ideally they would have been removed but meanwhile
56-
# it is simpler to guarantee they won't be duplicated in docs.
57-
Regex.replace(~r|(<[^>]*) id="[^"]*"([^>]*>)|, doc, ~S"\1\2", [])
45+
case :binary.split(doc, "\n\n") do
46+
[left, _] -> String.trim_trailing(left, ": ")
47+
[all] -> all
48+
end
5849
end
50+
def synopsis(_), do: nil
5951

6052
@doc """
6153
Add link headings for the given `content`.

lib/ex_doc/formatter/markdown/templates/module_template.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<% end %>
1010

1111
<%= if summary != [] do %>
12-
### Summary</h1>
12+
## Summary
1313
<%= for {name, nodes} <- summary, do: summary_template(name, nodes) %>
1414
<% end %>
1515

0 commit comments

Comments
 (0)