gitdown icon indicating copy to clipboard operation
gitdown copied to clipboard

Footnote links are not working.

Open geechartier opened this issue 2 years ago • 0 comments

The code that is generated for footnotes links is incorrect and causes the links to not work. The link to the footnote is generated like this:

<sup><a href="#fn-1" id="user-content-fnref-1">1</a></sup>

The footnote is like this:

<li id="user-content-fn-1">
    <p>
        First footnote
        <a href="#fnref-1">
            <g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji>
        </a>
    </p>
</li>

The href attribute of the link to the footnote does not match the target id attribute of the footnote <li> element. Also, the href attribute of the return link does not match the target id attribute of the footnote link.

If the footnote link is changed from

<sup><a href="#fn-1" id="user-content-fnref-1">1</a></sup>

to

<sup><a href="#user-content-fn-1" id="fnref-1">1</a></sup>

it works.

I have checked this directly in GitHub and the footnotes work there but not with HTML generated through GitDown.

geechartier avatar May 08 '22 07:05 geechartier