fix(mrml-core): parse quoted names in font-family values#637
Merged
Conversation
9bca834 to
c2a9b10
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #637 +/- ##
==========================================
+ Coverage 92.89% 92.95% +0.06%
==========================================
Files 227 206 -21
Lines 12203 11715 -488
==========================================
- Hits 11336 10890 -446
+ Misses 867 825 -42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`add_font_families` previously only split font-family attribute values on commas, so a value like `'Source Sans 3', Helvetica, Arial` was tokenised as `'Source Sans 3'` (with the surrounding single quotes). The quoted token then failed lookup against the registered `mj-font name="Source Sans 3"` and the corresponding Google Fonts `<link>` was never emitted in `<head>`. Replace the naive split with a small `parse_font_families` helper that splits and strips a single matching pair of `'` or `"` delimiters. Embedded commas inside `'One, Two'` are preserved as part of the family name. Signed-off-by: Federico Bond <federicobond@gmail.com>
c2a9b10 to
df52e69
Compare
jdrouet
requested changes
Apr 14, 2026
Owner
jdrouet
left a comment
There was a problem hiding this comment.
First review from my phone, I'll have another look later.
Thanks a lot for this PR!
Signed-off-by: Federico Bond <federicobond@gmail.com>
Merged
jdrouet
pushed a commit
that referenced
this pull request
Apr 25, 2026
## 🤖 New release * `mrml`: 6.0.0 -> 6.0.1 (✓ API compatible changes) * `mrml-cli`: 1.7.2 -> 1.7.3 * `mrml-python`: 0.2.3 -> 0.2.4 * `mrml-wasm`: 1.6.0 -> 1.6.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `mrml` <blockquote> ## [6.0.1](mrml-v6.0.0...mrml-v6.0.1) - 2026-04-25 ### Fixed - clippy issue - *(mrml-core)* parse quoted names in font-family values ([#637](#637)) ### Other - format code </blockquote> ## `mrml-cli` <blockquote> ## [1.7.3](mrml-cli-v1.7.2...mrml-cli-v1.7.3) - 2026-04-25 ### Other - update Cargo.lock dependencies </blockquote> ## `mrml-python` <blockquote> ## [0.2.4](mrml-python-v0.2.3...mrml-python-v0.2.4) - 2026-04-25 ### Other - updated the following local packages: mrml </blockquote> ## `mrml-wasm` <blockquote> ## [1.6.1](mrml-wasm-v1.6.0...mrml-wasm-v1.6.1) - 2026-04-25 ### Other - updated the following local packages: mrml </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add_font_familiespreviously only split font-family attribute values on commas, so a value like'Source Sans 3', Helvetica, Arialwas tokenised as'Source Sans 3'(with the surrounding single quotes). The quoted token then failed lookup against the registeredmj-font name="Source Sans 3"and the corresponding Google Fonts<link>was never emitted in<head>.Replace the naive split with a small
parse_font_familieshelper that splits and strips a single matching pair of'or"delimiters. Embedded commas inside'One, Two'are preserved as part of the family name.@jdrouet the current test case felt right but let me know if you prefer a comparison test according to the contributing guidelines.