feat(math): implement m:sSubSup sub-superscript converter (SD-2374)#2668
Conversation
Add convertSubSuperscript converter that transforms OMML m:sSubSup elements into MathML <msubsup> with three children (base, subscript, superscript), each wrapped in <mrow> for valid arity. Closes superdoc-dev#2597
- Add behavior test verifying m:sSubSup renders as <msubsup> with correct base/subscript/superscript children (x_i^2 from fixture) - Update stale comment that listed superscript as unimplemented
§22.1.2.104 is sSubSupPr (properties), §22.1.2.103 is sSubSup itself.
caio-pizzol
left a comment
There was a problem hiding this comment.
@gpardhivvarma looks good! converter works correctly across all the cases I tested — basic, nested, multi-part operands, Greek letters, styled text, and mixed equations.
pushed two small commits: added a missing browser test and fixed a spec section number in the JSDoc comment.
|
🎉 This PR is included in vscode-ext v1.1.0-next.60 |
|
🎉 This PR is included in @superdoc-dev/react v1.0.0-next.14 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.3.0-next.17 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.2.0-next.18 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.5.0-next.57 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.24.0-next.57 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.3.0-next.58 |
Implement m:func (Function Apply) OMML-to-MathML converter with upright function names per ECMA-376. Includes unit tests for edge cases and behavior E2E tests with a Word-native fixture. Rebased on main to resolve conflicts with m:sSubSup (superdoc-dev#2668).
…2709) Implement m:func (Function Apply) OMML-to-MathML converter with upright function names per ECMA-376. Includes unit tests for edge cases and behavior E2E tests with a Word-native fixture. Rebased on main to resolve conflicts with m:sSubSup (#2668). Co-authored-by: Caio Pizzol <caio@harbourshare.com>
Summary
convertSubSuperscriptconverter that transforms OMMLm:sSubSupinto MathML<msubsup>with three children (base, subscript, superscript)<mrow>for valid MathML arity (matches pattern in existing converters)MATH_OBJECT_REGISTRYand move from "Not yet implemented" to "Implemented"Test plan
m:sSubSup→<msubsup>with 3 children (x,i,2)m:sSubSupPris ignored<mrow>(x_{n+1}^{k-1}→ 3 children)m:sub/m:suphandled gracefullyCloses #2597