Skip to content

Commit 995b427

Browse files
committed
Change footnotes to match how GitHub renders them
1 parent 95f8015 commit 995b427

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@types/mdast": "^3.0.0",
4141
"hast-util-sanitize": "^4.0.0",
4242
"hast-util-to-html": "^8.0.0",
43-
"mdast-util-to-hast": "^11.0.0",
43+
"mdast-util-to-hast": "^12.0.0",
4444
"unified": "^10.0.0"
4545
},
4646
"devDependencies": {
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
<p>Here is a footnote reference,<a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>
2-
another,<a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>,
1+
<p>Here is a footnote reference,<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref aria-describedby="footnote-label">1</a></sup>
2+
another,<sup><a href="#user-content-fn-longnote" id="user-content-fnref-longnote" data-footnote-ref aria-describedby="footnote-label">2</a></sup>,
33
and optionally there are inline
44
notes.^[you can type them inline, which may be easier, since you don’t
55
have to pick an identifier and move down to type the note.]</p>
66
<p>This paragraph won’t be part of the note, because it
77
isn’t indented.</p>
8-
<section class="footnotes" role="doc-endnotes">
9-
<hr>
8+
<section data-footnotes class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
109
<ol>
11-
<li id="fn1" role="doc-endnote">
12-
<p>Here is the footnote.<a href="#fnref1" class="footnote-back" role="doc-backlink"></a></p>
10+
<li id="user-content-fn-1">
11+
<p>Here is the footnote. <a href="#user-content-fnref-1" data-footnote-backref class="data-footnote-backref" aria-label="Back to content"></a></p>
1312
</li>
14-
<li id="fn2" role="doc-endnote">
13+
<li id="user-content-fn-longnote">
1514
<p>Here’s one with multiple blocks.</p>
1615
<p>Subsequent paragraphs are indented to show that they
1716
belong to the previous footnote.</p>
1817
<pre><code>{ some.code }
1918
</code></pre>
2019
<p>The whole paragraph can be indented, or just the first
2120
line. In this way, multi-paragraph footnotes work like
22-
multi-paragraph list items.<a href="#fnref2" class="footnote-back" role="doc-backlink"></a></p>
21+
multi-paragraph list items. <a href="#user-content-fnref-longnote" data-footnote-backref class="data-footnote-backref" aria-label="Back to content"></a></p>
2322
</li>
2423
</ol>
2524
</section>

0 commit comments

Comments
 (0)