feat(math): implement m:sPre pre-sub-superscript converter#2747
Conversation
- Correct JSDoc OMML child order to spec (sPrePr, sub, sup, e) per ECMA-376 §22.1.2.99 - Move m:sPre into the implemented section of the converter registry - Add sibling-parity unit tests: properties-element filter, multi-run mrow wrap - Assert children.length === 4 in missing-case test to lock in arity invariant - Relocate describe block next to m:sSubSup; align test name with sibling convention - Reorder happy-path fixture to spec-correct child order - Add behavior tests + math-spre-tests.docx fixture covering 9 m:sPre shapes (basic, isotope, multi-run, only-sub, only-sup, no sPrePr, fraction-in-sub, nested sPre, display-mode oMathPara) - Add m:sPre round-trip test in math importer for child-order preservation
caio-pizzol
left a comment
There was a problem hiding this comment.
@Abdeltoto thanks for this — nice work. tested it in the app with a bunch of real equations (isotopes, multi-character scripts, nested pre-scripts, edge cases) and it renders the same as Word does.
i pushed two small commits directly since the changes were mechanical. first one — the comment at the top of the converter said Word writes the tags in the order base, sub, sup but Word actually sends them sub, sup, base. fixed the comment, reordered the test fixture to match what Word really produces, moved the registry entry out of the "not yet implemented" list it was still sitting in, and added a few more unit tests plus a new behavior test that loads a real .docx with nine pre-script shapes and checks each one renders right. second one — added one more test so if anyone changes how math gets saved back out, we catch it before a doc comes back different than it went in.
also uploaded the test doc to the shared corpus so the visual and layout regression runs pick it up automatically.
good to merge from my side once CI is green — flag anything you'd rather roll back.
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.3.0-next.6 |
|
🎉 This PR is included in template-builder v1.5.0-next.6 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.3.0-next.6 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.26.0-next.6 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.7.0-next.6 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.6.0-next.3 |
Closes #2609
Summary
Spec reference
ECMA-376 Section 22.1.2.99
Test plan
Made with Cursor