You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,34 @@ package system, module will add itself globally as `window.markdownitFootnote`.
90
90
91
91
### Customize
92
92
93
+
#### Custom href prefix
94
+
95
+
You can customize the `href` attribute in footnote links by providing a `footnoteHrefPrefix` in the `env` parameter when calling `render()`. This is useful when you want footnotes to link to a different page or use a custom URL structure:
Here is a footnote reference,[^1] and another.[^longnote]
4
+
5
+
[^1]: Here is the footnote.
6
+
7
+
[^longnote]: Here's one with multiple blocks.
8
+
.
9
+
<p>Here is a footnote reference,<sup class="footnote-ref"><a href="/docs#fn-my-doc-1" id="fnref-my-doc-1">[1]</a></sup> and another.<sup class="footnote-ref"><a href="/docs#fn-my-doc-2" id="fnref-my-doc-2">[2]</a></sup></p>
10
+
<hr class="footnotes-sep">
11
+
<section class="footnotes">
12
+
<ol class="footnotes-list">
13
+
<li id="fn-my-doc-1" class="footnote-item"><p>Here is the footnote. <a href="/docs#fnref-my-doc-1" class="footnote-backref">↩</a></p>
14
+
</li>
15
+
<li id="fn-my-doc-2" class="footnote-item"><p>Here's one with multiple blocks. <a href="/docs#fnref-my-doc-2" class="footnote-backref">↩</a></p>
Here is a footnote reference,[^1] and another.[^longnote]
4
+
5
+
[^1]: Here is the footnote.
6
+
7
+
[^longnote]: Here's one with multiple blocks.
8
+
.
9
+
<p>Here is a footnote reference,<sup class="footnote-ref"><a href="/custom/path#fn1" id="fnref1">[1]</a></sup> and another.<sup class="footnote-ref"><a href="/custom/path#fn2" id="fnref2">[2]</a></sup></p>
10
+
<hr class="footnotes-sep">
11
+
<section class="footnotes">
12
+
<ol class="footnotes-list">
13
+
<li id="fn1" class="footnote-item"><p>Here is the footnote. <a href="/custom/path#fnref1" class="footnote-backref">↩</a></p>
14
+
</li>
15
+
<li id="fn2" class="footnote-item"><p>Here's one with multiple blocks. <a href="/custom/path#fnref2" class="footnote-backref">↩</a></p>
16
+
</li>
17
+
</ol>
18
+
</section>
19
+
.
20
+
21
+
22
+
Inline footnote with custom href:
23
+
.
24
+
Here is an inline note.^[Inlines notes are easier to write.]
25
+
.
26
+
<p>Here is an inline note.<sup class="footnote-ref"><a href="/custom/path#fn1" id="fnref1">[1]</a></sup></p>
27
+
<hr class="footnotes-sep">
28
+
<section class="footnotes">
29
+
<ol class="footnotes-list">
30
+
<li id="fn1" class="footnote-item"><p>Inlines notes are easier to write. <a href="/custom/path#fnref1" class="footnote-backref">↩</a></p>
0 commit comments