File tree Expand file tree Collapse file tree 5 files changed +6
-6
lines changed Expand file tree Collapse file tree 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ defmodule ExDoc.DocAST do
62
62
end
63
63
64
64
defp ast_attributes_to_string ( attrs ) do
65
- Enum . map ( attrs , fn { key , val } -> " #{ key } =\" #{ val } \" " end )
65
+ Enum . map ( attrs , fn { key , val } -> " #{ key } =\" #{ ExDoc.Utils . h ( val ) } \" " end )
66
66
end
67
67
68
68
## parse markdown
Original file line number Diff line number Diff line change 25
25
<%= for group <- module.docs_groups, 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
- <%= if doc = group.doc do %>
28
+ <%= if doc = group.doc do %>
29
29
<div class="group-description" id="group-description-<%= key %>">
30
30
<%= render_doc(doc) %>
31
31
</div>
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ defmodule ExDoc.Formatter.HTML.Templates do
40
40
def module_type ( % { type: :module } ) , do: ""
41
41
def module_type ( % { type: type } ) , do: "<small>#{ type } </small>"
42
42
43
- defp enc ( binary ) , do: URI . encode ( binary )
43
+ defp enc ( binary ) , do: ExDoc.Utils . h ( URI . encode ( binary ) )
44
44
45
45
@ doc """
46
46
Create a JS object which holds all the items displayed in the sidebar area
Original file line number Diff line number Diff line change 1
1
<div class="summary-<%= text_to_id(name) %> summary">
2
2
<h2>
3
- <a href="#<%= text_to_id(name) %>"><%= name %></a>
3
+ <a href="#<%=h text_to_id(name) %>"><%= name %></a>
4
4
</h2>
5
5
<%= for node <- nodes do %>
6
6
<div class="summary-row">
7
7
<div class="summary-signature">
8
8
<a href="#<%=enc node.id %>" data-no-tooltip="" translate="no"><%=h node.signature %></a>
9
9
<%= if deprecated = node.deprecated do %>
10
- <span class="deprecated" title="<%= h( deprecated) %>">deprecated</span>
10
+ <span class="deprecated" title="<%=h deprecated %>">deprecated</span>
11
11
<% end %>
12
12
</div>
13
13
<%= if doc = node.doc do %>
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ defmodule ExDoc.Language.ElixirTest do
128
128
~s| <a href="https://hexdocs.pm/elixir/Kernel.html#+/2"><code class="inline">+/2</code></a>|
129
129
130
130
assert autolink_doc ( "`&/1`" ) ==
131
- ~s| <a href="https://hexdocs.pm/elixir/Kernel.SpecialForms.html#&/1"><code class="inline">&/1</code></a>|
131
+ ~s| <a href="https://hexdocs.pm/elixir/Kernel.SpecialForms.html#& /1"><code class="inline">&/1</code></a>|
132
132
133
133
assert autolink_doc ( "`for/1`" ) ==
134
134
~s| <a href="https://hexdocs.pm/elixir/Kernel.SpecialForms.html#for/1"><code class="inline">for/1</code></a>|
You can’t perform that action at this time.
0 commit comments