Skip to content

feat(math): implement m:sSubSup sub-superscript converter (SD-2374)#2668

Merged
caio-pizzol merged 4 commits intosuperdoc-dev:mainfrom
gpardhivvarma:feat/math-ssubsup-converter
Apr 3, 2026
Merged

feat(math): implement m:sSubSup sub-superscript converter (SD-2374)#2668
caio-pizzol merged 4 commits intosuperdoc-dev:mainfrom
gpardhivvarma:feat/math-ssubsup-converter

Conversation

@gpardhivvarma
Copy link
Copy Markdown
Contributor

Summary

  • Add convertSubSuperscript converter that transforms OMML m:sSubSup into MathML <msubsup> with three children (base, subscript, superscript)
  • Each operand wrapped in <mrow> for valid MathML arity (matches pattern in existing converters)
  • Register in MATH_OBJECT_REGISTRY and move from "Not yet implemented" to "Implemented"

Test plan

  • Basic conversion: m:sSubSup<msubsup> with 3 children (x, i, 2)
  • Properties element m:sSubSupPr is ignored
  • Multi-part operands wrapped in <mrow> (x_{n+1}^{k-1} → 3 children)
  • Missing m:sub/m:sup handled gracefully
  • All 27 OMML tests pass

Closes #2597

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
@gpardhivvarma
Copy link
Copy Markdown
Contributor Author

@caio-pizzol

- 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.
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@caio-pizzol caio-pizzol enabled auto-merge April 3, 2026 16:04
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 3, 2026
Merged via the queue into superdoc-dev:main with commit efa2961 Apr 3, 2026
50 checks passed
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in vscode-ext v1.1.0-next.60

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in @superdoc-dev/react v1.0.0-next.14

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in template-builder v1.3.0-next.17

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in esign v2.2.0-next.18

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in superdoc-cli v0.5.0-next.57

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in superdoc v1.24.0-next.57

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 3, 2026

🎉 This PR is included in superdoc-sdk v1.3.0-next.58

caio-pizzol added a commit to andrewsrigom/superdoc that referenced this pull request Apr 3, 2026
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).
github-merge-queue bot pushed a commit that referenced this pull request Apr 3, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Math: implement m:sSubSup sub-superscript converter (community)

2 participants