I find the spec slightly unclear or underspecified on Link reference definitions.
A link reference definition consists of a link label, optionally preceded by up to three spaces of indentation, followed by a colon (
:), optional spaces or tabs (including up to one line ending), a link destination, optional spaces or tabs (including up to one line ending), and an optional link title, which if it is present must be separated from the link destination by spaces or tabs.
First the sentence seems slightly contradictory it says that after a destination there may be optional space, tabs and one endline but then the end of the sentence says that the title must be separated by spaces and tabs, no end line is mentioned. I guess maybe what was meant is:
[…] it should be separated from the link destination by at least one space, tab or line ending.
Second I don’t understand how this wording defines the behaviour of example 197. Somehow in that example the “failure” to parse the link title results in the whole link reference definition to not being recognized (rather than take the the definition up to the link destination and treat the rest as inline)
But in the following example:
[foo]: /url 'the title' [foo]
The definition gets recognized up to the link destination by both
<p>'the</p> <p>title'</p> <p><a href="/url">foo</a></p>