Skip to content

Commit 2a60bd1

Browse files
committed
don't escape hrefs in type annotations
1 parent 36f52c7 commit 2a60bd1

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ your `README.md` to an `EDoc` file.
9494

9595

9696

97-
See [bin/MARKEDOC-README.md](http://github.com/esl/edown/blob/master/bin/MARKEDOC-README.md).
97+
See [bin/MARKEDOC-README.md](http://github.com/esl/gproc/blob/master/bin/MARKEDOC-README.md).
9898

9999

100100

@@ -113,9 +113,9 @@ See [bin/MARKEDOC-README.md](http://github.com/esl/edown/blob/master/bin/MARKEDO
113113

114114

115115
<table width="100%" border="0" summary="list of modules">
116-
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_doclet.md" class="module">edown_doclet</a></td></tr>
117-
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_layout.md" class="module">edown_layout</a></td></tr>
118-
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_lib.md" class="module">edown_lib</a></td></tr>
119-
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_make.md" class="module">edown_make</a></td></tr>
120-
<tr><td><a href="http://github.com/esl/edown/blob/master/doc/edown_xmerl.md" class="module">edown_xmerl</a></td></tr></table>
116+
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_doclet.md" class="module">edown_doclet</a></td></tr>
117+
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_layout.md" class="module">edown_layout</a></td></tr>
118+
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_lib.md" class="module">edown_lib</a></td></tr>
119+
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_make.md" class="module">edown_make</a></td></tr>
120+
<tr><td><a href="http://github.com/esl/gproc/blob/master/doc/edown_xmerl.md" class="module">edown_xmerl</a></td></tr></table>
121121

doc/edown_doclet.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
3131

3232

3333

34-
<pre>run(Command::[doclet_gen()](#type-doclet_gen) | [doclet_toc()](#type-doclet_toc), Ctxt::[edoc_context()](#type-edoc_context)) -&gt; ok</pre>
34+
<pre>run(Command::<a href="#type-doclet_gen">doclet_gen()</a> | <a href="#type-doclet_toc">doclet_toc()</a>, Ctxt::<a href="#type-edoc_context">edoc_context()</a>) -> ok</pre>
3535
<br></br>
3636

3737

@@ -43,8 +43,8 @@ Main doclet entry point.
4343

4444

4545

46-
Also see [`//edoc/edoc:layout/2`](http://www.erlang.org/doc/man/edoc.html#layout-2) for layout-related options, and
47-
[`//edoc/edoc:get_doc/2`](http://www.erlang.org/doc/man/edoc.html#get_doc-2) for options related to reading source
46+
Also see [`//edoc/edoc:layout/2`](/Users/uwiger/ETC/git/edoc/doc/edoc.md#layout-2) for layout-related options, and
47+
[`//edoc/edoc:get_doc/2`](/Users/uwiger/ETC/git/edoc/doc/edoc.md#get_doc-2) for options related to reading source
4848
files.
4949

5050
Options:
@@ -77,7 +77,7 @@ functions will also be included. The default value is <code>false</code>.
7777

7878

7979

80-
<dt><code>{overview, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code>
80+
<dt><code>{overview, <a href="/Users/uwiger/ETC/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
8181
</dt>
8282

8383

@@ -117,7 +117,7 @@ specified, no stylesheet reference will be generated.
117117

118118

119119

120-
<dt><code>{stylesheet_file, <a href="http://www.erlang.org/doc/man/edoc.html#type-filename">//edoc/edoc:filename()</a>}</code>
120+
<dt><code>{stylesheet_file, <a href="/Users/uwiger/ETC/git/edoc/doc/edoc.md#type-filename">//edoc/edoc:filename()</a>}</code>
121121
</dt>
122122

123123

doc/edown_layout.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ the source file. The default value is <code>true</code>.
118118

119119

120120

121-
<dd>Specifies an <a href="http://www.erlang.org/doc/man/index.html" target="_top"><code>xmerl</code></a> callback module to be
122-
used for exporting the documentation. See <a href="http://www.erlang.org/doc/man/xmerl.html#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
121+
<dd>Specifies an <a href="/Users/uwiger/ETC/git/xmerl/doc/index.md" target="_top"><code>xmerl</code></a> callback module to be
122+
used for exporting the documentation. See <a href="/Users/uwiger/ETC/git/xmerl/doc/xmerl.md#export_simple_content-2"><code>//xmerl/xmerl:export_simple_content/2</code></a> for details.
123123
</dd>
124124

125125

126126

127127

128128

129-
__See also:__ [//edoc/edoc:layout/2](http://www.erlang.org/doc/man/edoc.html#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a>
129+
__See also:__ [//edoc/edoc:layout/2](/Users/uwiger/ETC/git/edoc/doc/edoc.md#layout-2), [edown_doclet:layout/2](edown_doclet.md#layout-2).<a name="overview-2"></a>
130130

131131
###overview/2##
132132

doc/edown_make.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This function does not manage dependencies. It is simply a wrapper around
4949

5050

5151

52-
<pre>main(Args::[Config]) -&gt; [no_return()](#type-no_return)</pre>
52+
<pre>main(Args::[Config]) -> <a href="#type-no_return">no_return()</a></pre>
5353
<br></br>
5454

5555

src/edown_xmerl.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ rstrip(Str) -> re:replace(Str, "\\s\$", []).
6969
%% sure that the scope of a markup is not extended by mistake.)
7070

7171
'#element#'('pre_pre', Data, Attrs, Parents, E) ->
72-
'#element#'(pre, escape_pre(Data), Attrs, Parents, E);
72+
case re:run(Data, "<a href=", []) of
73+
{match, _} ->
74+
'#element#'(pre, Data, Attrs, Parents, E);
75+
nomatch ->
76+
'#element#'(pre, escape_pre(Data), Attrs, Parents, E)
77+
end;
7378
'#element#'('pre', Data, Attrs, Parents, E) ->
7479
xmerl_html:'#element#'('pre', Data, Attrs, Parents, E);
7580
'#element#'('div', Data, _, _Parents, _E) ->
@@ -178,6 +183,7 @@ md_elem(Tag, Data, Attrs, Parents, E) ->
178183

179184
within_html(Tags) ->
180185
lists:any(fun({pre,_}) -> true;
186+
({pre_pre,_}) -> true;
181187
({T,_}) -> needs_html(T)
182188
end, Tags).
183189

0 commit comments

Comments
 (0)