feat(math): implement m:acc accent converter#2748
Merged
caio-pizzol merged 5 commits intosuperdoc-dev:mainfrom Apr 12, 2026
Merged
feat(math): implement m:acc accent converter#2748caio-pizzol merged 5 commits intosuperdoc-dev:mainfrom
caio-pizzol merged 5 commits intosuperdoc-dev:mainfrom
Conversation
Made-with: Cursor
…y forms - Distinguish the three m:chr states from ECMA-376 §22.1.2.20: element absent → default U+0302; element present with missing/empty m:val → character absent (render bare base, no <mover>); m:val set → use it. Previous code rendered a circumflex for the "character absent" case. - Map combining marks (U+0300–U+036F, U+20D6/7) to their ASCII-range accent equivalents (^, ~, ¯, arrows, …) before placing in <mo>, so MathML renderers can use the stretchy accent operators. Firefox and MathJax stretch these across wide bases; Chrome's MathML Core does not yet stretch accents but the output is semantically correct. - Return null when m:e is absent (invalid per CT_Acc), so malformed input is dropped silently to match Word's behavior. - Move the registry entry out of the "Not yet implemented" block in omml-to-mathml.ts. - Expand unit tests from 3 to 11 covering every spec branch, the spacing mapping, multi-run base wrapping, and the missing-m:e case. - Add a behavior test asserting <mover accent="true"> + spacing-form <mo> output. SD-2382
# Conflicts: # packages/layout-engine/painters/dom/src/features/math/converters/index.ts # packages/layout-engine/painters/dom/src/features/math/omml-to-mathml.ts
# Conflicts: # packages/layout-engine/painters/dom/src/features/math/omml-to-mathml.test.ts # packages/layout-engine/painters/dom/src/features/math/omml-to-mathml.ts
# Conflicts: # packages/layout-engine/painters/dom/src/features/math/converters/index.ts # packages/layout-engine/painters/dom/src/features/math/omml-to-mathml.ts
Contributor
|
🎉 This PR is included in vscode-ext v2.3.0-next.7 |
Contributor
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.4 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in template-builder v1.5.0-next.7 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in esign v2.3.0-next.7 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc v1.26.0-next.7 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc-cli v0.7.0-next.7 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc-sdk v1.6.0-next.4 |
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.
Closes #2604
Summary
m:accOMML-to-MathML converter (diacritical marks above a base expression)m:accto MathML<mover accent="true">with a stretchy<mo>for the accent characterm:chris absent, matching Word behaviorMATH_OBJECT_REGISTRYSpec reference
ECMA-376 Section 22.1.2.1
Test plan
vitest runpasses for omml-to-mathml.test.ts