Skip to content

Commit f0db57f

Browse files
committed
Ensure edoc documents have the third element as a list
1 parent d935ebf commit f0db57f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ex_doc/doc_ast.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ defmodule ExDoc.DocAST do
8585
case content do
8686
# if we already have <pre><code>...</code></pre>, carry on
8787
[{:code, _, _}] ->
88-
{:pre, attrs, parse_erl_ast(content), %{}}
88+
{:pre, attrs, parse_erl_ast(List.wrap(content)), %{}}
8989

9090
# otherwise, turn <pre>...</pre> into <pre><code>...</code></pre>
9191
_ ->
92-
content = [{:code, [], parse_erl_ast(content), %{}}]
92+
content = [{:code, [], parse_erl_ast(List.wrap(content)), %{}}]
9393
{:pre, attrs, content, %{}}
9494
end
9595
end
9696

9797
defp parse_erl_ast({tag, attrs, content}) when is_atom(tag) do
98-
{tag, attrs, parse_erl_ast(content), %{}}
98+
{tag, attrs, parse_erl_ast(List.wrap(content)), %{}}
9999
end
100100

101101
@doc """

0 commit comments

Comments
 (0)