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

Embedded URIs with newlines result in incorrect anchors #44

Open
terrencegf opened this issue Apr 18, 2018 · 0 comments
Open

Embedded URIs with newlines result in incorrect anchors #44

terrencegf opened this issue Apr 18, 2018 · 0 comments

Comments

@terrencegf
Copy link

Embedded URIs should allow for newlines as shown in an example at http://docutils.sourceforge.net/docs/user/rst/quickref.html#hyperlink-targets . The current parsing of links assumes the link is contained on a single line, which can result in empty anchor links. Examples:

Correct when all on one line:

INPUT 
`Google <https://google.com>`_

OUTPUT
<p><a href="https://google.com">Google</a></p>

Incorrect when spanning two lines:

INPUT 
`Google
<https://google.com>`_

OUTPUT
<p><a href="">Google
&lt;https://google.com&gt;</a></p>

Note that the Online reStructuredText Editor (http://rst.ninjs.org) correctly renders the link in both cases.

I think the fix requires Parser.php to have a new 'state' when parsing links to allow for links that span multiple lines.

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

No branches or pull requests

1 participant