-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
nim doc/rst2html renders \v
, \\
, etc incorrectly
#17260
Comments
I'm not really familiar with RST and MD, but it seems to me that there are spec conflicts between RST inline interpreted text and MD inline code. https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules RST:
GitHub MD:
Fixing this issue means not supporting RST inline interpreted text. Which also means the |
I don't think that's correct, inline markup applies inside a text block, not a interpreted text block (things inside a single backtick pair) Furthermore, as you can see in https://github.com/quantimnot/Nim/blob/manual_rst_backtick_refactor/doc/manual.rst, after your PR the rst renders fine in github for
so it's just a bug specific to nim's rst to html renderer IMO; @a-mr can you confirm that this is also your understanding? |
Hi @timotheecour . Yes, I think you are almost correct. The RST spec does not cover escaping in interpreted text explicitly but the idea is mostly clear. De facto behavior of python rst2html is this:
It seems the rationale for this behavior is that interpreted text should be as flexible as possible — it can contain arbitrary syntax inside it. So handling of backslashes is completely up to the current role. For general
and should be still represented as
Summary: yes, we should fix our parser for the I can do it soon if you wish, I'm on vacation currently. |
Example 1
Current Output
1st line incorectly rendered:
Expected Output
Example 2
ditto with rst2html:
also renders incorrectly 1st line
Example 3
gives: t11956b.nim(3, 18) Error: '`' expected
which is wrong for 2 reasons:
Additional Information
\
:/cc @a-mr
examples 4
the devel docs are broken: https://nim-lang.github.io/Nim/system.html#addEscapedChar%2Cstring%2Cchar
note:
inline in github:
foo1
bar
v
\
\v
\\
foo2
bar
v
\
\v
\\
The text was updated successfully, but these errors were encountered: