Hi, recently I stumbled over a problem with the Markdown link syntax[1] This is [an example](http://example.com/ "Title") inline link. RFC 2396[2], section 2.3 defines left and right parentheses to be mark characters, and thus unreserved characters in URIs. This means that left and right parentheses do not need to be percent encoded in URIs.>From this definition it follows that the above inline link syntax cannot be parsed correctly in all cases. This can e.g. be shown with the online converter at Daring Fireball[3] and the sourceThe book of [Life](https://en.wikipedia.org/wiki/Life_(textbook) "Life textbook"). which is converted to <p>The book of <a href="https://en.wikipedia.org/wiki/Life_(textbook">Life</a> "Life textbook").</p> However, there's probably a solution to this problem. RFC 2396, 2.4.3 defines the left and right angle brackets as delimiters and explains that> The angle-bracket "<" and ">" and double-quote (") characters are > excluded because they are often used as the delimiters around URI in > text documents and protocol fields.This means that left and right angle brackets will never occur as part of an URI. So deprecating parentheses, and replacing the parentheses with angle brackets in Markdown's inline link syntax would resolve the problem described. As an additional benefit, this would unify Markdown inline link syntax and reference-style link syntax, and simplify link parsing. Any thoughts on this? -- Regards, Alexander Veit [1]: <http://daringfireball.net/projects/markdown/syntax#link> [2]: <http://www.ietf.org/rfc/rfc2396.txt> [3]: <http://daringfireball.net/projects/markdown/dingus> (Markdown 1.0.2b7)
Le 20-juin-2013 ? 14:48, Alexander Veit <lbloom at gmx.net> a ?crit :> The book of [Life](https://en.wikipedia.org/wiki/Life_(textbook) "Life textbook"). > > which is converted to > > <p>The book of <a href="https://en.wikipedia.org/wiki/Life_(textbook">Life</a> "Life textbook").</p>Most Markdown implementations out there do the right thing: matching opening and closing parenthesis. It's just sad that Markdown.pl doesn't. http://johnmacfarlane.net/babelmark2/?normalize=1&text=The+book+of+%5BLife%5D(https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FLife_(textbook)+%22Life+textbook%22).%0A> However, there's probably a solution to this problem. RFC 2396, 2.4.3 defines the left and right angle brackets as delimiters and explains that > >> The angle-bracket "<" and ">" and double-quote (") characters are >> excluded because they are often used as the delimiters around URI in >> text documents and protocol fields. > > This means that left and right angle brackets will never occur as part of an URI. So deprecating parentheses, and replacing the parentheses with angle brackets in Markdown's inline link syntax would resolve the problem described. As an additional benefit, this would unify Markdown inline link syntax and reference-style link syntax, and simplify link parsing.Angle brackets surrounding the URL are supported by most Markdown parsers, but the URL must be kept inside the parens. Unfortunately, only some parsers correctly use them to disambiguate: http://johnmacfarlane.net/babelmark2/?normalize=1&text=%5BBrackets%5D(%3Chttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2F)%3E+%22Brackets%22).%0A -- Michel Fortin michel.fortin at michelf.ca http://michelf.ca
* Alexander Veit <lbloom at gmx.net> [2013-06-20 20:50]:> recently I stumbled over a problem with the Markdown link syntax[1] > > This is [an example](http://example.com/ "Title") inline link. > > RFC 2396[2], section 2.3 defines left and right parentheses to be mark > characters, and thus unreserved characters in URIs. This means that > left and right parentheses do not need to be percent encoded in URIs.I?ve run into this as well. The easiest solution (which, since you?re already writing the link inline, is not much of a loss) is to work around it by falling back to HTML for the link in question, i.e. write it as <a href="">. It?s a wart, but can be lived with. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>