sites/plugins
randogoth bfb54d3ffa Add footnote support to smolnet
itsybitsy's Markdown parser has no footnote extension enabled, so a
[^key] reference and its [^key]: definition were passing through as
literal bracket text in every capsule. SMOLNET_FOOTNOTES, off by
default, rewrites references into numbered [N] markers in order of
first appearance and relocates definitions to a trailing "## Notes"
section.

Verified against sublunar.space's real content (the first site to turn
this on), which surfaced three cases synthetic test data would not
have:

- A definition whose citation link lazy-wraps onto an unindented
  second physical line (ordinary CommonMark paragraph continuation)
  was truncated at the first newline, leaving the wrapped half as
  orphaned, bracket-broken text in the body. FOOTNOTE_DEF now consumes
  lazy-continuation lines up to the next blank line or next
  definition, and joins them back into one line.
- A reference immediately followed by an ordinary colon in the
  author's own prose ("Gnosis[^gnosis]: collective critique...") was
  being skipped by a now-redundant negative lookahead that existed to
  avoid confusing a reference with a definition's own opening bracket
  -- a confusion FOOTNOTE_DEF already resolves upstream by stripping
  every genuine definition line before FOOTNOTE_REF ever runs.
- An assigned footnote number could collide with a pre-existing bare-
  integer reference-link id already used elsewhere in the same
  article (sixnames.md cites sources that way); CommonMark would
  silently resolve the collision into an unrelated hyperlink. Numbers
  are now assigned skipping any integer a "[N]: url" definition
  already owns in the same document.

randogoth.com has no footnotes in its content (grep confirmed), so it
is unaffected either way; zonetoast.com's content could not be checked
from here, which is why this stays opt-in rather than on by default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-10 15:24:39 +03:00
..
lostimages.py fix: recover one hotlinked image, retire the other eleven 2026-10-06 11:04:28 +03:00
smolnet.py Add footnote support to smolnet 2026-10-10 15:24:39 +03:00