Footnotes improvements by ysard · Pull Request #1218 · Python-Markdown/markdown (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation3 Commits5 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Hi, I suggest in this PR 2 improvements for the footnotes module.
- Small refactor of the
BACKLINK_TITLE
option; The use offormat()
instead of "old"%d
formatter allows
to specify text without the need to have the number of the footnote in it (like footnotes on Wikipedia for example).
The modification is backward compatible so no configuration change is required. - Addition of a new option
SUPERSCRIPT_TEXT
that allows to specify a custom placeholder for the footnote itself in the text.
Ex: [1] or (1) or just by default, the current behavior: 1.
Some writing rules specify these subtleties I think it could be useful.
Thanks for reading.
- The placeholder '{}' is optional. So a user can choose to include or not the footnote number in the backlink text.
- The modification is backward compatible with configurations using the old '%d' placeholder.
- The addition of a new SUPERSCRIPT_TEXT option allows to specify a placeholder receiving the footnote number for the superscript text.
These look like some good improvements/changes to me. Of course, we do need to include an update to the changelog. However, as this is adding a new feature, it will need to be in a new feature release, which means a new document will need to be added for the release notes. However, we already have PR #1187 which handles that. This can be finalized and merged after that.
Thanks for the review, tests are added and passing (Ran 945 tests in 3.294s, OK (skipped=21))
. I also added the changelog hoping that it will make your work easier after the merge for 3.4.
Labels
The pull request is ready to be merged.
Related to one or more of the included extensions.
Feature request.
2 participants