Skip to content

Commit

Permalink
Escape HTML special characters in sidebar (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
eksperimental authored Jul 18, 2020
1 parent 5fed479 commit d26ca71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ex_doc/formatter/html/templates.ex
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ defmodule ExDoc.Formatter.HTML.Templates do
end

defp sidebar_entries({group, docs}) do
nodes = Enum.map(docs, fn doc -> %{id: doc.id, anchor: URI.encode(HTML.link_id(doc))} end)
nodes = Enum.map(docs, fn doc -> %{id: h(doc.id), anchor: URI.encode(HTML.link_id(doc))} end)
%{key: HTML.text_to_id(group), name: group, nodes: nodes}
end

Expand Down

0 comments on commit d26ca71

Please sign in to comment.