Skip to content

Conversation

@mattConnHarbour
Copy link
Contributor

@mattConnHarbour mattConnHarbour commented Feb 11, 2026

Some DOCX generators list fonts with a semicolon separator. This PR makes sure those are replaced with commas before turning into CSS rules.

This fixes an issue with incorrect font being rendering in the layout engine, leading to text extending beyond document boundaries.

@linear
Copy link

linear bot commented Feb 11, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e914e3ccac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +195 to +198
if (trimmed.includes(';')) {
trimmed = trimmed
.split(';')
.map((part) => part.trim())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not split semicolons inside quoted font names

The new semicolon normalization splits on every ; without considering quotes, so a literal family like "Foo;Bar" is rewritten to "Foo, Bar" before the early comma return. That changes the actual font identifier and causes incorrect font matching for any document that uses quoted font names containing semicolons, which this function previously preserved.

Useful? React with 👍 / 👎.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattConnHarbour check and add a response if applicable/or not

Copy link
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall small change, make sure to add tests

const trimmed = fontName.trim();
let trimmed = fontName.trim();
// replace semicolon font fallback separators
if (trimmed.includes(';')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once semicolons become commas, the comma check on line 202 returns early -- no sans-serif fallback gets added.

works today because the import path already adds one, but if this function gets called with raw "Liberation Sans;Arial" it'll be missing a generic fallback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also.. needs tests for semicolon inputs -- the early return on line 202 skipping fallbacks is easy to miss without one. toCssFontFamily("Liberation Sans;Arial") and toCssFontFamily("Foo;Bar", { wordFamily: 'swiss' }) would cover it.

Comment on lines +195 to +198
if (trimmed.includes(';')) {
trimmed = trimmed
.split(';')
.map((part) => part.trim())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattConnHarbour check and add a response if applicable/or not

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.

2 participants