vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Nested parenthesis in href breaks inline hyperlinks #45

Closed brandonc closed 13 years ago

brandonc commented 13 years ago

A tricky edge case is parenthesis inside inline urls. Sundown and github flavored markdown both seem to stop on the first occurrence of )

Perhaps this can be fixed by counting nested parenthesis?

vmg commented 13 years ago

Hey Brandon,

the Markdown standard defines that any "active" characters that need to retain their literal values must be prefixed with a backslash, i.e. escaped. Parentheses clearly fall under this category.

[the Pogo](http://en.wikipedia.org/wiki/Pogo_\(dance\))

Let's dance the Pogo. Pogo pogo pogo pogo pogo pogo. Note that the first backslash in the opening parenthesis is not required, it's there for completeness.

Cheers!

brandonc commented 13 years ago

Thanks for the clarification!