diff --git a/docs/userGuide/syntax/footnotes.md b/docs/userGuide/syntax/footnotes.md index f9600cea95..f6722b5132 100644 --- a/docs/userGuide/syntax/footnotes.md +++ b/docs/userGuide/syntax/footnotes.md @@ -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). +### Footnote Back-Link + +Each footnote definition now includes a back-to-reference link (“↩”) +that jumps back to the original marker. + +**Rendered HTML example:** + +```html +Here is a footnote reference,[^1] + +[^1]: This is the footnote. + +
```html diff --git a/packages/cli/test/functional/test_site/index.md b/packages/cli/test/functional/test_site/index.md index 0c3eff0c2f..6d080e499b 100644 --- a/packages/cli/test/functional/test_site/index.md +++ b/packages/cli/test/functional/test_site/index.md @@ -356,3 +356,17 @@ and **this**. {{ code elements should automatically be assigned v-pre }} {% endraw %} + +
+ +

Footnote Back-Link Test

+ +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. + diff --git a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js index ab192a6682..8ed3fa1221 100644 --- a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js +++ b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js @@ -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 ' \u21a9\uFE0E'; - - return ''; + /* ↩ with escape code to prevent display as Apple Emoji on iOS */ + return ' \u21A9\uFE0E'; }