mirror of
https://github.com/jgm/pandoc.git
synced 2026-07-10 19:37:12 +00:00
c8fda8f4d3
Instead of having an initial pass where we collect reference definitions, we create links with target `##SUBST##something` or `##REF##something` or `##NOTE##something`, and resolve these in a pass over the parsed AST. This allows us to handle link references that are not at the top level. Closes #10281.
688 B
688 B
% pandoc -f rst
`click here`__ or `click here`__
.. _link1: http://www.example.com/
.. _link2: http://johnmacfarlane.net/pandoc/
__ link1_
__ link2_
^D
<p><a href="http://www.example.com/">click here</a> or <a
href="http://johnmacfarlane.net/pandoc/">click here</a></p>
Multiple indirection:
% pandoc -f rst
`click here`__
.. _link1: link2_
.. _link2: http://johnmacfarlane.net/pandoc/
__ link1_
^D
<p><a href="http://johnmacfarlane.net/pandoc/">click here</a></p>
Loop detection:
% pandoc -f rst
`click here`__
.. _link1: link2_
.. _link2: link1_
__ link1_
^D
2> [WARNING] Circular reference 'link1' at line 8 column 1
<p><a href="">click here</a></p>