Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RST Reader: Escaped Colons are allowed in References to URLs #7568

Closed
tkurtbond opened this issue Sep 14, 2021 · 1 comment
Closed

RST Reader: Escaped Colons are allowed in References to URLs #7568

tkurtbond opened this issue Sep 14, 2021 · 1 comment
Labels

Comments

@tkurtbond
Copy link

Escaped colons are allowed in references to URLs in reStructuredText.

For example, the following reStructuredText file (file
ecaairtu-example.rst) is valid:

While `Labyrinth Lord: Revised Edition`_ (LLRE; PDF and POD) has been
criticized for not being a completely faithful retro-clone of the
Moldvay/Cook/Marsh Basic/Expert D&D rules (B/X), I think it still
holds a useful spot.

.. _Labyrinth Lord\: Revised Edition: https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition

Notice that the colon in the middle of hyperlink reference on the first
line is not escaped, but the colon in the middle of the hyperlink
target on the last line is escaped with a backslash, since an
unescaped colon is what ends the reference id of the hyperlink target.

I'm using the following version of Pandoc:

pandoc 2.14.1
Compiled with pandoc-types 1.22, texmath 0.12.3, skylighting 0.11,
citeproc 0.4.1, ipynb 0.1.0.1

and the following version of the docutils toolchain:

rst2html (Docutils 0.16 [release], Python 3.9.7, on linux)

My OS information is:

Linux ulrich 5.13.8-100.fc33.x86_64 #1 SMP Wed Aug 4 14:15:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Fedora release 33 (Thirty Three)

For the reStructuredText file above, the resulting html output (ecaairtu-example-pandoc.html) generated by pandoc is:

<p>While <a href="">Labyrinth Lord: Revised Edition</a> (LLRE; PDF and POD) has been criticized for not being a completely faithful retro-clone of the Moldvay/Cook/Marsh Basic/Expert D&amp;D rules (B/X), I think it still holds a useful spot.</p>

and it was generated by the command

pandoc -r rst -w html --output=ecaairtu-example-pandoc.html ecaairtu-example.rst

which produces the error message:

[WARNING] Reference not found for 'labyrinth lord: revised edition' at ecaairtu-example.rst line 1 column 41

The html output (ecaairtu-example-docutils.html) as generated by the docutils tool chain (and omitting the uninteresting header and footer) is

<p>While <a class="reference external" href="https://www.drivethrurpg.com/product/64332/Labyrinth-Lord-Revised-Edition">Labyrinth Lord: Revised Edition</a> (LLRE; PDF and POD) has been
criticized for not being a completely faithful retro-clone of the
Moldvay/Cook/Marsh Basic/Expert D&amp;D rules (B/X), I think it still
holds a useful spot.</p>

and is generated by the command

rst2html  ecaairtu-example.rst | sed '1,/^<div class="document">/d' | sed -e '1,2d' -e '\%</div>%,$d' >ecaairtu-example-docutils.html

and produces no error messages.

@jgm
Copy link
Owner

jgm commented Sep 17, 2021

Closed by a3162d3

@jgm jgm closed this as completed Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants