fix(math): use U+2015 for underbar accent instead of U+0332 (SD-2403)#2621
Open
caio-pizzol wants to merge 3 commits intomainfrom
Open
fix(math): use U+2015 for underbar accent instead of U+0332 (SD-2403)#2621caio-pizzol wants to merge 3 commits intomainfrom
caio-pizzol wants to merge 3 commits intomainfrom
Conversation
Closes #2610 - Add convertBar() in converters/bar.ts: - Reads m:barPr/m:pos@m:val to determine position - 'top' (default) → <mover> with U+203E (overline) - 'bot' → <munder> with U+0332 (combining low line) - stretchy='true' so the bar stretches over the base expression - Register 'm:bar': convertBar in MATH_OBJECT_REGISTRY - Export convertBar from converters/index.ts - Add 3 unit tests: overbar, underbar, missing barPr fallback
- Default to munder (underbar) when no position is specified, matching Word's rendering behavior (posVal !== 'top') - Wrap base content in <mrow> to correctly group multi-token expressions like 'x + y' as a single MathML child - Move m:bar entry from 'Not yet implemented' to 'Implemented' section in the registry - Strengthen tests: assert base content text and <mo> character for all three cases (top, bot, default)
U+0332 (combining low line) renders invisibly in some browsers when used as a standalone MathML operator. Replace with U+2015 (horizontal bar) which renders consistently. Also moves m:f to the "Implemented" section in the math object registry.
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.
Replace U+0332 (combining low line) with U+2015 (horizontal bar) for the math underbar accent character. U+0332 is a combining character that renders invisibly in some browsers when used as a standalone MathML operator inside
<mo>. U+2015 is a non-combining character that renders consistently.Also moves
m:f(fraction) to the "Implemented" section in the math object registry — it was listed under "Not yet implemented" despite having a converter.\u0332to\u2015inbar.tsm:fto correct registry sectionDepends on #2619.
SD-2403