Cannot handle ( ) within link URLs #237

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

Projects

None yet

3 participants

@postmodern

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

[bash](man:bash(1))

Produces:

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

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

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

@postmodern

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

@robin850 robin850 was assigned May 26, 2013
@robin850
Collaborator

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 robin850 added a commit that referenced this issue Jun 1, 2013
@robin850 robin850 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
aead1ff
@robin850
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