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

Cannot handle ( ) within link URLs #237

Closed
postmodern opened this Issue May 7, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@postmodern
Copy link

postmodern commented May 7, 2013

I noticed that redcarpet cannot handle nested ( ) within the URL part of links.

[bash](man:bash(1))

Produces:

<p><a>bash</a>)</p>
@aprescott

This comment has been minimized.

Copy link

aprescott commented May 7, 2013

[bash](http://example.com/bash_(1\)) will render <a href="http://example.com/bash_(1)">bash</a>:

[bash](http://example.com/bash_(1\))

@postmodern

This comment has been minimized.

Copy link

postmodern commented May 7, 2013

Kramdown correctly parses nested ( ), without requiring backslash escaping.

@ghost ghost assigned robin850 May 26, 2013

@robin850

This comment has been minimized.

Copy link
Collaborator

robin850 commented May 26, 2013

After a bit of investigating, I've found that here in markdown.c, Redcarpet considers the first found parenthesis as link's end. I will try to fix this soon! Thanks for reporting.

robin850 added a commit that referenced this issue Jun 1, 2013

Ensure nested parenthesis are handled into links
Make sure that parenthesis inside the link's url are correctly parsed
Redcarpet considered the first ")" occurrence as the link's end so we
first count the number of open "(" and decrement this number each
time we found a ")".

Close issue #237
@robin850

This comment has been minimized.

Copy link
Collaborator

robin850 commented Jun 1, 2013

I'm closing this since #258 has been merge ; I don't know why it hasn't been automagically closed when the PR has been merge...Sorry for the delay by the way.

@robin850 robin850 closed this Jun 1, 2013

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