I do not understand something about link reference definitions. The spec says that there can be an optional whitespace between the link label and the link destination, and another optional whitespace between the link destination and the optional link title, but to me the reference implementations are only accepting spaces and tabulations.
For example, “[foo]: /url” should be parsed as a link reference definition because " " (a space and two form feeds) is a whitespace (isn’t it ?), but it is parsed as a paragraph by the C implementation and the interactive dingus.
Could somebody please explain it to me ?
(Sorry for my bad english ^^)
The ref. link definition cannot span over blank lines.
See https://spec.commonmark.org/0.28/#link-reference-definitions and consider link ref. definition more as an inline rather then a block in this context.
AFAIK, cmark (as the reference implementation) does not parse reference link definitions until the document is broken into blocks. And for ordinary paragraph blocks, it looks whether some initial line(s) of it can be interpreted as one or more link reference definitions.
Yes, the specs should likely be clearer on this.
According to the spec, form feed should count as
whitespace. The spec says that the space between link
label and destination, and between destination and
title, can contain at most one line ending character,
but a form feed is not a line ending character.
Hence you are right that according to the spec, this
should be allowed. It is, technically, a bug in the
reference implementations – feel free to submit a
bug report on GitHub.
However, we may want to rethink allowing form feed as
a whitespace character for these purposes. Any
opinions on this?