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/markdown parser can't handle extra parentheses after link #10475

Closed
GULPF opened this issue Jan 27, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@GULPF
Copy link
Member

commented Jan 27, 2019

Code:

import packages/docutils/[rstgen, rst], strtabs

echo rstToHtml("( [Nim](https://nim-lang.org/) )", {roSupportMarkdown}, newStringTable(modeStyleInsensitive))
echo rstToHtml("([Nim](https://nim-lang.org/))", {roSupportMarkdown}, newStringTable(modeStyleInsensitive))

Output:

( <a class="reference external" href="https://nim-lang.org/">Nim</a> )
([Nim](<a class="reference external" href="https://nim-lang.org/">https://nim-lang.org/</a>))

Expected output:

( <a class="reference external" href="https://nim-lang.org/">Nim</a> )
(<a class="reference external" href="https://nim-lang.org/">Nim</a>)

@GULPF GULPF added the Stdlib label Jan 27, 2019

@narimiran

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

I've investigated a bit and the problem is that the closing )) gets parsed as one token inside of RstParser, and parseMarkdownLink is searching for a token which is ) — it can't find it and hence it thinks there's no link.

A similar thing would have happened if you had a double [[ in the beginning of a link, e.g. [[Nim]((https://nim-lang.org/) some other text].

narimiran added a commit to narimiran/Nim that referenced this issue Apr 10, 2019

narimiran added a commit to narimiran/Nim that referenced this issue Apr 10, 2019

@Araq Araq closed this in 1494d88 Apr 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.