Skip to content

🔩 Use single braces for footnote-number references - #40

Open
JFWooten4 wants to merge 2 commits into
mainfrom
single-brace-footnote-references-20261015
Open

JFWooten4 wants to merge 2 commits into
mainfrom
single-brace-footnote-references-20261015

Conversation

@JFWooten4

@JFWooten4 JFWooten4 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Use {key} instead of {{key}} to insert an already-assigned Markdown footnote number into prose, without creating a new citation or changing its numbering.
  • Preserve the clickable link to the numbered footnote and the normal [^key] citation/definition syntax.
  • Keep legacy double-braced expressions literal, rather than inadvertently rendering {{key}} as {7}.
  • Update the README and regression tests for the new syntax, including references before their citation, repeated citations, whitespace, unresolved names, and end-to-end PDF generation.

Why simplify the syntax?

I originally used two pairs of braces to make note-number references stand out visually in raw Markdown. That distinction was useful when scanning the text as a human, but it is not necessary when a machine resolves and replaces the placeholders. A single pair of braces is simpler to type, read, and maintain, while the named reference still unambiguously identifies the assigned footnote number.

Example

The first proposition.[^smith]

See supra note {smith}.

[^smith]: Smith v. Jones, 123 U.S. 456.

If smith is assigned note 7, the second paragraph renders “See supra note 7.” with 7 linked to the actual footnote.

Code-block safety

Footnote numbers must come from actual prose citations, not examples of Markdown syntax. The compiler now preserves literal {key} placeholders, [^key] citations, and [^key]: definitions inside fenced code blocks. Both backtick and tilde fences are recognized, including longer delimiters. Inline backtick code spans are also protected from interpolation and citation numbering. This is enforced when extracting definitions, assigning numbers, rendering both PDF modes, and grouping endnotes by section.

Regression tests cover fenced code, inline code, longer backtick/tilde fences, preserved code-only definitions, and correct endnote sections.

Compatibility and verification

This is an intentional source-syntax change: existing documents that use {{key}} must change those references to {key}. Such legacy expressions remain visible rather than being half-interpolated.

Verified the committed tree differs from main, and reviewed the three-file diff. Added regression coverage and performed focused fence/inline-code helper smoke checks, but the full Python test suite was not executed in this environment.

Replace double-braced note-number placeholders with single-braced references while preserving assigned numbering and clickable PDF links. Keep legacy double braces literal, and update documentation and regression tests.

Co-authored-by: Codex Web <noreply@openai.com>
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pdf Ready Ready Preview Oct 16, 2026 12:25am UTC

Exclude fenced code and inline code spans from footnote definition extraction, citation numbering, and named-reference interpolation. Render fenced lines literally in both PDF renderers and keep endnote grouping aligned with actual prose citations. Add regression coverage for backtick and tilde fences and inline code.

Co-authored-by: Codex Web <noreply@openai.com>

This branch was successfully deployed

1 active deployment
Preview — 7c50d183 Deployed Oct 16, 2026 by vercel[bot]
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