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 Links containing an URI get parsed twice #4581

Closed
danse opened this issue Apr 23, 2018 · 4 comments
Closed

RST Links containing an URI get parsed twice #4581

danse opened this issue Apr 23, 2018 · 4 comments

Comments

@danse
Copy link
Contributor

danse commented Apr 23, 2018

nested inlines are not allowed in RST but pandoc parses these inlines
recursively. in the case of a link this can lead to a double parsing
due to implicit links. this can garble an RST document going through a
round-trip workflow

$ pandoc --version
pandoc 2.1.4
$ pandoc -f rst -t html | pandoc -f html -t rst
`http://loc <http://loc>`__
` <http://loc>`__\ http://loc
$ pandoc -f rst -t native
`http://loc <http://loc>`__
[Para [Link ("",[],[]) [Link ("",[],[]) [Str "http://loc"] ("http://loc","")] ("http://loc","")]]
@danse
Copy link
Contributor Author

danse commented Jul 24, 2018

hi, i don't understand why the solution i proposed three months ago, which follows rST specifications, has been ignored after a discussion while this issue has been closed with a different approach which:

  • adds code that fixes the problem only for links, while the problem is more general
  • duplicates code adding a processing step rather than updating the parser

the solution i proposed also fixes #4561, which has been closed as unsolvable. this is a confirmation that the problem of nested inlines is better solved in the general case

@danse
Copy link
Contributor Author

danse commented Jul 24, 2018

i created #4792 in order to better discuss the topic of parsing nested inlines

@jgm
Copy link
Owner

jgm commented Jul 24, 2018

@danse I'm sorry, I lost track of your solution here.
I agree that a general approach that follows the rST spec better would be good. (When I originally wrote the rST reader, I didn't realize that nested inlines weren't allowed.)

Anyway, the fix committed above can be reverted and replaced with something better. We'll continue discussion on #4792.

jgm pushed a commit that referenced this issue Jul 24, 2018
RST does not allow nested emphasis, links, or other inline
constructs.

Closes #4581, double parsing of links with URLs as
link text.  This supersedes the earlier fix for #4581
in 6419819.

Fixes #4561, a bug parsing with URLs inside emphasis.

Closes #4792.
@jgm jgm mentioned this issue Jul 24, 2018
@danse
Copy link
Contributor Author

danse commented Jul 25, 2018

@danse I'm sorry, I lost track of your solution here

No worries, with all the activity going on about pandoc i reckon keeping track of conversation isn't easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants