Hoedown parses footnotes and regular document content differently:
Footnotes are parsed straight from the source document
Regular text is first normalized, then the normalized version is parsed.
This means that regular text has certain nice properties: tabs are expanded to spaces, lines are guaranteed to end in \n, and there is a newline at the end of the document. There are several locations in Hoedown's code that implicitly depend on these assumptions. However, the code at these locations is also used when parsing footnotes, where these assumptions do not hold.
To fix this problem, one would need to change how Hoedown processes the document:
Normalize the input text (expand tabs, ensure \n at the right places)
Hoedown parses footnotes and regular document content differently:
This means that regular text has certain nice properties: tabs are expanded to spaces, lines are guaranteed to end in
\n
, and there is a newline at the end of the document. There are several locations in Hoedown's code that implicitly depend on these assumptions. However, the code at these locations is also used when parsing footnotes, where these assumptions do not hold.To fix this problem, one would need to change how Hoedown processes the document:
\n
at the right places)