Fossil Forum
dennis
5 days, 7 hours ago
Post: The Markdown interpreter ignores whitespace between link text and link label/destination
It seems the markdown interpreter is ignoring whitespaces between link text and link label or destination. This means you can't have another link or anything in a parenthesis following a shortcut reference link (linkformat #7 in the markdown rules).
Is this expected behavior? I believe whitespace was allowed in the original markdown syntax, but I don't think it is allowed in the CommonMark Spec (see inline link, full reference link, and collapsed reference link).
Either way it makes shortcut reference links a bit awkward to use. Here are some examples:
Example 1 - shortcut reference link is mistaken for a full reference link
> [Link1] [Link2] is an example.
[Link1]: https://example.com/1
[Link2]: https://example.com/2
Becomes:
Link2 is missing, and Link1 points to the address of Link2.
What I expected:
Example 2 - parenthesis following shortcut reference is interpreted as inline link
> [Link3] ([Link4]) is an example.
[Link3]: https://example.com/3
[Link4]: https://example.com/4
Becomes:
Link3 now points to [Link4] literally.
What I expected:
Example 3 - shortcut reference link is ignored when followed by inline link
> [Link5] [Link6](https://example.com/6) is an example.
[Link5]: https://example.com/5
Becomes:
What I expected: