Skip to content

Commit

Permalink
don't escape hrefs in type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
uwiger committed Dec 30, 2011
1 parent 36f52c7 commit 2a60bd1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -94,7 +94,7 @@ your `README.md` to an `EDoc` file.



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



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


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

10 changes: 5 additions & 5 deletions doc/edown_doclet.md
Expand Up @@ -31,7 +31,7 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla



<pre>run(Command::[doclet_gen()](#type-doclet_gen) | [doclet_toc()](#type-doclet_toc), Ctxt::[edoc_context()](#type-edoc_context)) -&gt; ok</pre>
<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>
<br></br>


Expand All @@ -43,8 +43,8 @@ Main doclet entry point.



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

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



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


Expand Down Expand Up @@ -117,7 +117,7 @@ specified, no stylesheet reference will be generated.



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


Expand Down
6 changes: 3 additions & 3 deletions doc/edown_layout.md
Expand Up @@ -118,15 +118,15 @@ the source file. The default value is <code>true</code>.



<dd>Specifies an <a href="http://www.erlang.org/doc/man/index.html" target="_top"><code>xmerl</code></a> callback module to be
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.
<dd>Specifies an <a href="/Users/uwiger/ETC/git/xmerl/doc/index.md" target="_top"><code>xmerl</code></a> callback module to be
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.
</dd>





__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>
__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>

###overview/2##

Expand Down
2 changes: 1 addition & 1 deletion doc/edown_make.md
Expand Up @@ -49,7 +49,7 @@ This function does not manage dependencies. It is simply a wrapper around



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


Expand Down
8 changes: 7 additions & 1 deletion src/edown_xmerl.erl
Expand Up @@ -69,7 +69,12 @@ rstrip(Str) -> re:replace(Str, "\\s\$", []).
%% sure that the scope of a markup is not extended by mistake.)

'#element#'('pre_pre', Data, Attrs, Parents, E) ->
'#element#'(pre, escape_pre(Data), Attrs, Parents, E);
case re:run(Data, "<a href=", []) of
{match, _} ->
'#element#'(pre, Data, Attrs, Parents, E);
nomatch ->
'#element#'(pre, escape_pre(Data), Attrs, Parents, E)
end;
'#element#'('pre', Data, Attrs, Parents, E) ->
xmerl_html:'#element#'('pre', Data, Attrs, Parents, E);
'#element#'('div', Data, _, _Parents, _E) ->
Expand Down Expand Up @@ -178,6 +183,7 @@ md_elem(Tag, Data, Attrs, Parents, E) ->

within_html(Tags) ->
lists:any(fun({pre,_}) -> true;
({pre_pre,_}) -> true;
({T,_}) -> needs_html(T)
end, Tags).

Expand Down

0 comments on commit 2a60bd1

Please sign in to comment.