I believe there is a mismatch between the behavior defined by the spec and the dingus reference implementation with regards to the link destination of a link reference definition.
According to the spec, a link destination can, “includes parentheses only if (a) they are backslash-escaped or (b) they are part of a balanced pair of unescaped parentheses.”
For example, the following does not qualify as a proper link destination because it has an unescaped, unmatched left parenthesis.
It should be parsed as a paragraph with no link, which is what the dingus outputs.
So far so good. Now let us look at the spec’s definition for a link reference definition.
A link reference definition consists of a link label indented up to three spaces, followed by a colon (
:), optional whitespace (including up to one line ending), a link destination…
Given that the definition of a link destination is shared between inline links and link reference definitions, I would expect the following to not produce a link.
[ref][abc] [abc]: a(bc.com
Yet sure enough, it does in the dingus!
To me, this seems like a deficiency in the spec, a bug in the reference implementation, or both. Am I missing something here?