Add InlineFootnotesExtension for inline footnotes#90
Draft
dereuromark wants to merge 3 commits intomasterfrom
Draft
Add InlineFootnotesExtension for inline footnotes#90dereuromark wants to merge 3 commits intomasterfrom
dereuromark wants to merge 3 commits intomasterfrom
Conversation
Implements inline footnotes using span syntax: `[content]{.fn}`
This approach follows the discussion in jgm/djot#286, avoiding the
syntax conflict between Pandoc's `^[...]` and djot's superscript `^text^`.
Changes:
- Add `registerInlineFootnote()` method to HtmlRenderer for extension use
- Add `InlineFootnotesExtension` that converts `.fn` spans to footnotes
- Inline footnotes integrate seamlessly with regular footnotes
- Supports full inline formatting in footnote content
- Add comprehensive test coverage (13 tests)
- Document extension in extensions.md
Related: jgm/djot#286
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #90 +/- ##
=========================================
Coverage 93.50% 93.51%
- Complexity 2302 2313 +11
=========================================
Files 78 79 +1
Lines 6070 6107 +37
=========================================
+ Hits 5676 5711 +35
- Misses 394 396 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InlineFootnotesExtensionthat converts[content]{.fn}spans to inline footnotesregisterInlineFootnote()method toHtmlRendererfor extension useUsage
Why This Syntax?
This follows the approach discussed in jgm/djot#286. Pandoc's
^[...]syntax conflicts with djot's superscript^text^, so the span-with-class approach provides inline footnotes without parser changes.Edge Cases Tested
.fn