Skip to content

feat(math): implement m:m matrix converter#2753

Merged
caio-pizzol merged 1 commit intosuperdoc-dev:mainfrom
Abdeltoto:feat/math-matrix-converter
Apr 14, 2026
Merged

feat(math): implement m:m matrix converter#2753
caio-pizzol merged 1 commit intosuperdoc-dev:mainfrom
Abdeltoto:feat/math-matrix-converter

Conversation

@Abdeltoto
Copy link
Copy Markdown
Contributor

Closes #2601

Summary

  • Implements the m:m OMML-to-MathML converter for matrices
  • Maps m:m to <mtable> with <mtr> rows and <mtd> cells
  • Each m:mr row's m:e cells are converted independently using convertChildren
  • Returns null for empty matrices
  • Registers the converter in MATH_OBJECT_REGISTRY
  • Adds 3 unit tests covering 2x2 matrix, empty matrix, and 1x3 row vector

Spec reference

ECMA-376 Section 22.1.2.60

Test plan

  • vitest run passes for omml-to-mathml.test.ts
  • Linter and formatter pass (lefthook pre-commit)

@caio-pizzol caio-pizzol self-assigned this Apr 9, 2026
@caio-pizzol caio-pizzol force-pushed the feat/math-matrix-converter branch 3 times, most recently from 8c873b5 to e8af231 Compare April 13, 2026 23:50
Convert the OMML matrix element (m:m) to MathML <mtable>. Each m:mr row
becomes an <mtr> and each m:e cell becomes an <mtd> wrapping an <mrow>
that holds the converted cell content, matching the pattern used by
fraction/equation-array/radical/nary converters.

- Empty m:e cells are preserved as positional gaps per §22.1.2.32 and
  render a U+25A1 placeholder by default so the layout matches Word's
  rendering. m:plcHide in m:mPr suppresses the placeholder (§22.1.2.83).
- Remaining m:mPr properties (mcs/mcJc/baseJc) are ignored for now;
  follow-up work will map per-column justification onto <mtable>
  columnalign.

Spec: ECMA-376 §22.1.2.60
@caio-pizzol caio-pizzol force-pushed the feat/math-matrix-converter branch from e8af231 to bb2f86e Compare April 14, 2026 00:08
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 14, 2026
Merged via the queue into superdoc-dev:main with commit 47777f5 Apr 14, 2026
47 of 50 checks passed
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.10

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.13

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in template-builder v1.5.0-next.13

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in esign v2.3.0-next.13

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc-cli v0.7.0-next.14

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc v1.26.0-next.13

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 14, 2026

🎉 This PR is included in superdoc-sdk v1.6.0-next.11

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:m matrix converter (community)

2 participants