Skip to content

Support Substack-style footnotes in the article popover#5362

Open
dave-atx wants to merge 1 commit into
Ranchero-Software:mainfrom
dave-atx:substack-footnote-support
Open

Support Substack-style footnotes in the article popover#5362
dave-atx wants to merge 1 commit into
Ranchero-Software:mainfrom
dave-atx:substack-footnote-support

Conversation

@dave-atx

@dave-atx dave-atx commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.

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>
@dave-atx dave-atx requested a review from brentsimmons as a code owner July 9, 2026 23:32
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.

1 participant