Skip to content

Duplicate footnote names cause incorrect rendering and numbering #2649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ehuss opened this issue Apr 7, 2025 · 1 comment · Fixed by #2681
Closed

Duplicate footnote names cause incorrect rendering and numbering #2649

ehuss opened this issue Apr 7, 2025 · 1 comment · Fixed by #2681
Assignees
Labels
A-footnotes Area: footnotes C-bug Category: A bug, incorrect or unintended behavior

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 7, 2025

Problem

When there are duplicate footnote definitions, it can cause the numbering to be off and generally cause confusion.

Steps

Example page:

# Chapter 1

Test[^example]

Something else[^other]

Test2[^example]

[^example]: Definition one

[^other]: Other

[^example]: Definition two

This renders as:

Image

Several problems:

  • The second example definition shows up, but nothing links to it.
  • The "Something else" footnote number is 2, but clicking it takes you to footnote 3.

Possible Solution(s)

Should probably warn if there are duplicate footnote definitions, and ignore/delete subsequent duplicates.

Notes

mdbook v0.4.48

Version


@ehuss ehuss added C-bug Category: A bug, incorrect or unintended behavior A-footnotes Area: footnotes labels Apr 7, 2025
@krishanjmistry
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-footnotes Area: footnotes C-bug Category: A bug, incorrect or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants