8000 (minor) Notes without blank line at end of document aren't parsed · Issue #63 · jgm/lunamark · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
(minor) Notes without blank line at end of document aren't parsed #63
Open
@Omikhleia

Description

@Omikhleia

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&#39;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&#39;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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0