Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/userGuide/syntax/footnotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ Normal footnotes won't work when used inside the attributes of MarkBind componen
For example, it won't work in the `header` attribute of [panels](../components/presentation.html#panels).
</box>

### Footnote Back-Link

Each footnote definition now includes a back-to-reference link (“↩”)
that jumps back to the original marker.

**Rendered HTML example:**
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section title 'Rendered HTML example' is misleading as it shows markdown syntax on line 43, not just HTML. Consider changing to 'Example:' or 'Markdown and HTML example:' for accuracy.

Suggested change
**Rendered HTML example:**
**Markdown and HTML example:**

Copilot uses AI. Check for mistakes.


```html
Here is a footnote reference,[^1]

[^1]: This is the footnote. <a href="#fnref1" class="footnote-backref">↩</a>
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTML example shows raw HTML output but doesn't demonstrate the markdown syntax that produces this result. Consider showing both the markdown input and the rendered HTML output to be clearer.

Copilot uses AI. Check for mistakes.



<div id="short" class="d-none">

```html
Expand Down
14 changes: 14 additions & 0 deletions packages/cli/test/functional/test_site/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,17 @@ and **this**.
<code>{{ code elements should automatically be assigned v-pre }}</code>

{% endraw %}

<hr>

<header><h2>Footnote Back-Link Test</h2></header>

This test verifies that each footnote includes a ↩ link back to its reference.

Here is a footnote reference,[^1]

[^1]: This is test content for footnote back-link.

When rendered, you should see a ↩ after the footnote, and clicking it
should scroll back up to the original marker.

Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,8 @@ function render_footnote_anchor(tokens, idx, options, env, slf) {
id += ':' + tokens[idx].meta.subId;
}

// CHANGE HERE
// Below line adds backreferences, but doesn't work well with panels, so disabled for now.
// Old code:
// /* ↩ with escape code to prevent display as Apple Emoji on iOS */
// return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>';

return '';
/* ↩ with escape code to prevent display as Apple Emoji on iOS */
return ' <a href="#fnref' + id + '" class="footnote-backref">\u21A9\uFE0E</a>';
}


Expand Down