Skip to content

Feat/upper limit converter Math: implement m:limUpp upper limit converter (community) #2600#2788

Closed
Anuj52 wants to merge 6 commits intosuperdoc-dev:mainfrom
Anuj52:feat/upper-limit-converter
Closed

Feat/upper limit converter Math: implement m:limUpp upper limit converter (community) #2600#2788
Anuj52 wants to merge 6 commits intosuperdoc-dev:mainfrom
Anuj52:feat/upper-limit-converter

Conversation

@Anuj52
Copy link
Copy Markdown
Contributor

@Anuj52 Anuj52 commented Apr 12, 2026

Description

Implemented the m:limUpp (upper limit) OMML to MathML converter to support rendering math objects with limits positioned above a base expression (e.g., "max" with a limit above).

Changes

  • New Converter: Created upper-limit.ts to map m:limUpp to MathML .
  • Registration: Registered the new converter in the MATH_OBJECT_REGISTRY.
  • Exports: Exported the converter from the converters index.

Verification Results

  • Unit Tests: Added comprehensive test cases in omml-to-mathml.test.ts. All tests passed (59/59).
  • Visual Verification: Verified correct rendering of the sd-2378-limupper.docx test file in the development environment.

Ref: SD-2378
Screenshot 2026-04-13 014231

Anuj52 and others added 6 commits April 12, 2026 20:03
- Dedupe duplicate `m:rad converter` describe block in omml-to-mathml.test.ts
- Add unit test for empty <m:deg/> with no <m:degHide> — Word's round-trip
  canonical form for "no explicit degree". Without the empty-deg check this
  case produced an invalid <mroot> with an empty index.
- Add unit tests for ST_OnOff "on" / "off" variants on m:degHide
  (ECMA-376 §22.9.2.7) — Word normalizes these on save but other DOCX
  producers (Google Docs, LibreOffice, Pages) may emit them.
- Treat m:degHide val="off" as not hidden — previously interpreted as true.
- Restore correct spec citation §22.1.2.88 for m:rad (the prior change to
  §22.1.2.86 was incorrect; §22.1.2.88 is the rad section in ECMA-376).
- Add math-radical-tests.docx behavior fixture (3 cases: canonical sqrt,
  cube root, empty-deg-no-degHide).
- Add behavior tests asserting <msqrt> / <mroot> shape per case and that
  no <mroot> ever has an empty index.
Add unit tests for m:val="1" (canonical Word output) and m:val="true"
(ST_OnOff true alias) so degHide handling for the common true values is
locked in, complementing the existing "no val" / "on" / "off" / "0" cases.
@caio-pizzol
Copy link
Copy Markdown
Contributor

hey @Anuj52, thanks for the follow-up, and congrats on getting #2784 merged yesterday!

bad timing on this one though — #2771 landed a few hours ago and already ships both m:limLow and m:limUpp, so the upper-limit piece here is a duplicate.

the radical changes and tests in this PR are your own work from #2784 that's already on main — this branch just never got rebased, so they're showing up again.

i'd close this one. if you spot any issues with the math equation features that have been landing — bugs, edge cases, rendering problems — please open a PR or file an issue and we'll be happy to take a look. thanks again!

@Anuj52 Anuj52 deleted the feat/upper-limit-converter branch April 14, 2026 09:28
@Anuj52 Anuj52 restored the feat/upper-limit-converter branch April 14, 2026 09:29
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.

3 participants