Skip to content

Conversation

arshinsikka
Copy link

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:

  • Re-enable the “↩” back-to-reference link in footnote definitions by returning the anchor in render_footnote_anchor
  • Update the User Guide to document the footnote back link under the “Footnotes” section
  • Add a manual functional test in test_site/index.md to verify that each footnote shows a ↩ link and that clicking it scrolls back to the original marker

Anything you'd like to highlight/discuss:

  • We’ve updated both code and docs so users know the feature exists
  • The manual test is added to the CLI test site; no automated unit tests exist for footnote rendering today
  • Let me know if you’d prefer an automated snapshot test instead

Testing instructions:

  1. Rebuild web assets:
    npm run build:web

  2. Serve the test site:
    npx markbind serve packages/cli/test/functional/test_site

  3. In your browser, navigate to Footnotes examples near the bottom of the page.

  4. Confirm that each footnote item now has a ↩ link.

  5. Click the ↩ link and verify it scrolls you back to the original superscript reference.

Proposed commit message: (wrap lines at 72 characters)

feat(footnotes): add back-to-reference link for footnotes (#2699)

Re-enables the “↩” link on footnotes so readers can return to the
original reference. Updates User Guide and adds a manual test case
to verify back-link rendering and behavior.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@damithc damithc requested a review from Copilot August 7, 2025 14:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request re-enables the footnote back-to-reference link feature in MarkBind, allowing users to click a "↩" link in footnote definitions to jump back to the original reference marker.

  • Re-enables the previously disabled back-to-reference link in footnote rendering
  • Updates User Guide documentation to explain the footnote back-link feature
  • Adds a manual functional test to verify the back-link functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js Re-enables the footnote anchor rendering to include back-to-reference links
packages/cli/test/functional/test_site/index.md Adds manual test case for footnote back-link functionality
docs/userGuide/syntax/footnotes.md Documents the footnote back-link feature in the User Guide

```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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants