Support Substack-style footnotes in the article popover#5362
Open
dave-atx wants to merge 1 commit into
Open
Conversation
Substack footnote references are bare <a id="footnote-anchor-N" href="#footnote-N"> anchors (not wrapped in <sup> like Multimarkdown), and their targets are backlink anchors whose note text lives in the following sibling elements rather than inside the target itself. Neither the footnote badge styling nor the newsfoot popover recognized them. - main.js: broaden styleLocalFootnotes() to also badge these bare anchors, and let isLocalFootnote() accept the "#footnote-" hash prefix (it previously only matched "#fn"). - newsfoot.js: add a Substack footnote format that recognizes the reference and extracts note content from the sibling elements after the backlink; the click handler now uses each format's own content extractor instead of assuming the target's innerHTML. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
This addresses issue #5361 .
"Substack-style" footnote references are bare anchor tags instead of being wrapped in
<sup>tags like MultiMarkdown. This PR adds detection for that style of footnote to the Javascript in the Article Rendering stack so that they render with the fancy popovers as well.