feat(math): implement m:acc accent converter#2748
feat(math): implement m:acc accent converter#2748caio-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
|
🎉 This PR is included in vscode-ext v2.3.0-next.7 |
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.4 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.5.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.3.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.26.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.7.0-next.7 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.6.0-next.4 |
|
🎉 This PR is included in superdoc-cli v0.7.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.27.0 The release is available on GitHub release |
|
🎉 This PR is included in @superdoc-dev/react v1.2.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.6.0 |
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