Skip to content

Parsing Inconsistencies for Multi-Block Footnote Bodies #388

@rdestefa

Description

@rdestefa

Not sure if this should be considered a "bug" since the GFM spec doesn't have a section on footnotes, and their documentation doesn't seem quite accurate either, but given that it seems like this repo aims to achieve similar behavior to GitHub I'm marking it as a bug for now. Feel free to change.

When writing a footnote body, you can include multiple paragraphs by indenting subsequent paragraphs by 4 spaces relatively, so doing this produces 1

[^1]: First paragraph

    Second paragraph

This kind of works for commonmark-java, except that you need to include 4 spaces in all blank lines (I'm using the GLFM dingus since the regular CommonMark dingus doesn't support this feature):

This works

GLFM Example

[^1]: First paragraph
••••
    Second paragraph
<section class="footnotes" data-footnotes>
<ol>
<li id="fn-1">
<p>
First paragraph</p>
<p>
Second paragraph <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1"></a>
</p>
</li>
</ol>
</section>
This doesn't

GLFM Example

[^1]: First paragraph

    Second paragraph
<pre><code>Second paragraph
</code>
</pre>
<section class="footnotes" data-footnotes>
<ol>
<li id="fn-1">
<p>
First paragraph <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1"></a>
</p>
</li>
</ol>
</section>
This doesn't

GLFM Example (This one has weird behavior there too)

[^1]: First paragraph
••
    Second paragraph
<pre><code>Second paragraph
</code>
</pre>
<section class="footnotes" data-footnotes>
<ol>
<li id="fn-1">
<p>
First paragraph <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1"></a>
</p>
</li>
</ol>
</section>
This doesn't

GLFM Example

[^1]: First paragraph
••••

    Second paragraph
<pre><code>Second paragraph
</code>
</pre>
<section class="footnotes" data-footnotes>
<ol>
<li id="fn-1">
<p>
First paragraph <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1"></a>
</p>
</li>
</ol>
</section>

Here's a more complex example.

Footnotes

  1. First paragraph

    Second paragraph

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions