Skip to content

fix(html): keep a generic font family a keyword - #1271

Merged
andiwand merged 1 commit into
mainfrom
fix/generic-font-family
Oct 25, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix/generic-font-family

Conversation

@andiwand

@andiwand andiwand commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

translate_font_family quotes a bare font name and adds its kind, as the unreleased CHANGELOG says. It did that to a generic family too. So the monospace that Markdown names its code with became 'monospace',sans-serif, a font no one has. Every code span and code block of a Markdown file showed in the text font.

A generic family (serif, sans-serif, monospace, …) is now written as it is.

Found while testing the website with the core of main plus #1270: sample.md showed inline code and its fenced block in the proportional font. 7.5.2 showed them monospace.

Reference output. Three pages change, each only in that font-family:

  • md/feature-matrix.md: 'monospace',sans-serif becomes monospace.
  • odt/style-java+paste-1.odt (private): 'Monospace',sans-serif becomes Monospace. That pasted Java code is monospace again too.
  • odt/style+charset-wikipedia-1.odt (private): 'sans-serif',sans-serif becomes sans-serif.

I regenerate the references once, after this and #1270 land.

Tests. gtest font_family_keeps_a_generic_family_a_keyword. The full suite passes (2542).

Review fixes

  • Rebased onto main after fix: preserve text edits and spreadsheet formula correctness #1270. No code change was needed.
  • I checked that is_generic_font_family ignores case, as the CSS generic keywords do, so the unquoted Monospace of the private odt is the keyword too. A list that ends in a generic family still takes the list path.
  • I rendered md/feature-matrix.md: its 7 code rules state font-family:monospace.
  • Tested: the html and document style gtests (154).

translate_font_family quoted a bare name and added its kind, so the
monospace that Markdown names its code with became the font
'monospace',sans-serif, which no one has: every code span and block of a
Markdown file showed in the text font. A generic family is now written
as it is.

Found in the website with the core of main: sample.md showed its code
in the proportional font.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
@andiwand
andiwand force-pushed the fix/generic-font-family branch from 708a065 to df33763 Compare October 25, 2026 10:08
@andiwand
andiwand merged commit 194d0cc into main Oct 25, 2026
14 of 16 checks passed
@andiwand
andiwand deleted the fix/generic-font-family branch October 25, 2026 10:08
andiwand added a commit that referenced this pull request Oct 25, 2026
The sheet editor and text editor scripts of #1270, and three pages
whose generic font family #1271 keeps a keyword.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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