Open
Description
Found by @jslabovitz (via discussion)
If a (foot)note is the last element in a document, without blank line(s) after it, it fails to be parsed.
Test for reproducing
local lunamark = require("lunamark")
local opts = { notes = true }
local writer = lunamark.writer.html5.new(opts)
local parse = lunamark.reader.markdown.new(writer, opts)
local result, matadata = parse([[
Here is a note.[^mynote]
[^mynote]: This is supposed to be the note's footnote.
]])
print(result)
582D Observed result
<p>Here is a note.[^mynote]</p>
[^mynote]: This is supposed to be the note's footnote.
Expected result
<p>Here is a note.<sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup></p>
<hr />
<ol class="notes">
<li id="fn1"><p>This is supposed to be the note's footnote. <a href="#fnref1" class="footnoteBackLink">↩</a></p></li>
</ol>
Rationale
For comparison, Pandoc is happy parsing the note whether there's a blank line or not.
The workaround is easy (just adding a blank line), but it could be misleading to users.
Metadata
Metadata
Assignees
Labels
No labels