Markdown links do not interpret parenthesis in URLs correctly

This looks more like an issue with the URL and commonmark. If you balance the opening and closing parentheses by adding )))))) to the end, the markdown link is properly parsed.

link

[link](https://www.depotlegal.be/Depot/form.aspx?SC=KBRVITRINE1#/Search/(query:(AdvancedQuery:(queryGroups:!((queryClauses:!((index:KBR264b_idx,logical:0,operator:0,otherValue:!n,value:'petites%20singularit%C3%A9s'))))))))

This matches the behavior in the CommonMark Spec, which the markdown-it engine follows (used by Discourse).

a nonempty sequence of characters that does not start with <, does not include ASCII control characters or space character, and includes parentheses only if (a) they are backslash-escaped or (b) they are part of a balanced pair of unescaped parentheses. (Implementations may impose limits on parentheses nesting to avoid performance issues, but at least three levels of nesting should be supported.)

This can be tested also in the markdown-it demo.

3 Likes