Apply smart typography inside box and conversation elements - #44
Conversation
box and conversation built their own bare MarkdownIt instances, so -- stayed literal and quotes stayed straight while the rest of the slide got en dashes and smart quotes. Factor the shared renderer config into colloquium/md.py and use it everywhere. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 078068e00a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def create_base_md() -> MarkdownIt: | ||
| """Return a markdown-it renderer with the deck's shared typography.""" | ||
| md = MarkdownIt("commonmark", {"html": True, "typographer": True}) | ||
| md.enable(["table", "replacements", "smartquotes"]) | ||
| return md |
There was a problem hiding this comment.
Add the required Unreleased changelog entry
This PR adds user-visible smart-typography behavior, but its diff leaves CHANGELOG.md untouched, so the release notes omit the change despite the repository requirement that every PR add one PR-linked line under ## [Unreleased]. Add that summary before merging.
AGENTS.md reference: AGENTS.md:L15-L18
Useful? React with 👍 / 👎.
Points the git pin at the natolambert/colloquium#44 merge commit so box and conversation blocks render en dashes and smart quotes like the rest of the slide text. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Text inside
box andconversation blocks didn't get smart typography:--rendered as two literal hyphens and quotes stayed straight, while the surrounding slide text got proper en dashes and curly quotes (screenshot case: "The plan" box on rlhfbook.com lecture decks).Root cause: the two elements construct their own bare
MarkdownIt("commonmark", {"html": True})instances, missing thetypographer: trueoption and thereplacements/smartquotesrules the main pipeline enables in_create_md_renderer.Fix: factor the shared base config into
colloquium/md.py(create_base_md()) and use it in the main pipeline,box.py, andconversation.py— so the three renderers can't drift again. The main pipeline still layersdollarmathon top; elements also gaintablesupport, matching main-pipeline behavior.Tests
Two new tests assert
--→ – and"..."→ curly quotes inside box content and conversation messages. Full suite: 237 passed, 1 skipped.🤖 Generated with Claude Code