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:

> [Link1]    [Link2] is an example.
[Link1]: https://example.com/1
[Link2]: https://example.com/2

Becomes:

Link1 Link2 is an example.

Link2 is missing, and Link1 points to the address of Link2.

What I expected:

Link1 Link2 is an example.

> [Link3] ([Link4]) is an example.
[Link3]: https://example.com/3
[Link4]: https://example.com/4

Becomes:

Link3 (Link4) is an example.

Link3 now points to [Link4] literally.

What I expected:

Link3 (Link4) is an example

> [Link5] [Link6](https://example.com/6) is an example.
[Link5]: https://example.com/5

Becomes:

Link5 Link6 is an example.

What I expected:

Link5 Link6 is an example

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button