github / cmark-gfm

GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GFM footnotes: line ending in footnote definition label causes text to disappear

wooorm opened this issue · comments

commented

Problem

Take for example:

[^a
b]: # c

xxx[^a
b].

Yields:

[^]: # c

xxx[^].


For some reason, the a\nb disappear from both places. I can’t imagine why that would happen?

Aside

whitespace is not allowed in footnote definitions at all. With spaces and tabs, I feel like that too is a bug, that they should be supported?

For line endings, I agree that they should not be supported in footnote definitions labels.
Reasoning being that they work as containers (just like block quotes, list items).
Containers take a slice from the start of the line.
But if those “slices” run across multiple lines, how do they mix with other containers?

* [^a]: > * b

^-- a paragraph in a list in a block quote in a definition in another list.

* [^a
* what is this? Another item? Or just part of the identifier?
b]: c