Linebreaks inside link labels

I was wondering what is a motivation for allowing linebreaks inside link labels.

For example:

[
foo
]: /url

[ foo ]

According to babelmark2, most markdown implementations do not recognize it as a link.

I can guess that it’s motivated by ability of having very long labels which span across multiple lines, is that right?

I am concerned as it seems for me that this feature introduces incompatibility with other markdown implementations and makes parsing a bit harder, while (arguably) doesn’t make a big improvement in terms of human readability.

I am not (yet) proposing to change the specification, but just wondering about motivation for this.

P.S: It seems that there is some issue with commonmark on babelmark2. In the example that I linked above [ foo ] is not recognised as matching link reference label, even though it is recognised by commonmark’s dingus

1 Like

Thanks - I’ve updated commonmark.js on babelmark2. The version there before was quite old.

The motivation for allowing line breaks is, as you suspected, that long labels might need to break across multiple lines. (Even short labels might do so, if they begin near the end of a line in a hard wrapped document.)

1 Like