Skip to content

🐞 Render literal inline code in PDF body text and footnotes - #41

Open
JFWooten4 wants to merge 1 commit into
mainfrom
inline-code-footnote-filenames-20261016
Open

JFWooten4 wants to merge 1 commit into
mainfrom
inline-code-footnote-filenames-20261016

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Give backtick-delimited inline code real formatting and literal parsing in PDFs, especially when referring to filenames, paths, and commands inside footnotes.

Changes

  • Parse exact-length backtick runs, including double-backtick spans for content that contains backticks; retain unmatched delimiters and support backslash-escaped backticks.
  • Render spans in the built-in Courier monospace face at the surrounding paragraph size, preserving filename punctuation such as underscores, brackets, asterisks, HTML-sensitive characters, and URLs.
  • Protect code contents before footnote citation detection, note-number interpolation, Markdown emphasis, smart-quote substitution, and URL auto-linking.
  • Apply the same protection during initial document footnote numbering and quotation-local citation substitution. This prevents literal [^filename] or {{note-key}} inside a code span from turning into actual citations or links.
  • Document usage in the README and add regression tests covering inline formatting, escaped and doubled delimiters, code within footnotes and quotation-local notes, and extracted PDF text/font selection.

Example

The attachment is `records_2026_[final].csv`.[^file]

[^file]: Use `reports/2026/records_2026_[final].csv` to identify the file.

The filenames should remain literal and monospaced; their square brackets and underscores are not citation or emphasis syntax.

Validation

  • Verified the committed tree differs from main and contains the renderer, README, and new test file changes.
  • Ran a standalone local parser/ReportLab smoke test covering filenames, HTML escaping, delimiter runs, escaped backticks, whitespace, and Courier fragments.
  • Added six repository-level regression tests, including an integration test for the font of a footnote filename in the generated PDF. The full repository test suite has not been executed in this environment.

This PR targets inline code spans; changing the existing fenced-code-block renderer is out of scope.

Render matched backtick spans with a monospace font while protecting their contents from Markdown emphasis, links, smart quotes, footnote numbering, and note-number interpolation. Support escaped and multi-backtick delimiters in body text, document footnotes, and quotation-local footnotes, with regression coverage and documentation.

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 3:47pm UTC

This branch was successfully deployed

1 active deployment
Preview — cc8b1c05 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