Skip to content

Commit f89ee45

Browse files
authored
Fix strip_app to always rewrap in a list (#2124)
1 parent dfa2ab4 commit f89ee45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ex_doc/language/erlang.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,15 @@ defmodule ExDoc.Language.Erlang do
418418
end
419419

420420
defp strip_app([{:code, attrs, [code], meta}], app) do
421-
[{:code, attrs, strip_app(code, app), meta}]
421+
[{:code, attrs, List.wrap(strip_app(code, app)), meta}]
422422
end
423423

424424
defp strip_app(code, app) when is_binary(code) do
425-
String.trim_leading(code, "//#{app}/")
425+
List.wrap(String.trim_leading(code, "//#{app}/"))
426426
end
427427

428428
defp strip_app(other, _app) do
429-
other
429+
List.wrap(other)
430430
end
431431

432432
defp warn_ref(href, config) do

0 commit comments

Comments
 (0)