Skip to content

feat(math): implement m:d delimiter converter (SD-2380)#2710

Merged
caio-pizzol merged 9 commits intosuperdoc-dev:mainfrom
andrewsrigom:feat/math-delimiter-converter
Apr 9, 2026
Merged

feat(math): implement m:d delimiter converter (SD-2380)#2710
caio-pizzol merged 9 commits intosuperdoc-dev:mainfrom
andrewsrigom:feat/math-delimiter-converter

Conversation

@andrewsrigom
Copy link
Copy Markdown
Contributor

@andrewsrigom andrewsrigom commented Apr 2, 2026

Summary

  • implement the m:d OMML -> MathML converter
  • register the converter in the OMML converter registry
  • add tests covering default delimiters, custom separators, and empty-expression handling

Testing

  • pnpm exec vitest run packages/layout-engine/painters/dom/src/features/math/omml-to-mathml.test.ts
  • validated manually in the dev app with the issue test document

Closes #2611

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2079a7a82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@andrewsrigom andrewsrigom force-pushed the feat/math-delimiter-converter branch from f2079a7 to 804c4d3 Compare April 2, 2026 22:15
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.

@andrewsrigom clean implementation, follows the existing converter pattern nicely.

two issues to fix — both confirmed by comparing SuperDoc rendering against Word (test file + screenshots below).

1. element present without m:val should mean "no character" — right now <m:begChr/> (no attribute) behaves the same as the element being absent, so it renders (. the spec says it should render nothing. same applies to endChr and sepChr.

2. wrong default separator — should be \u2502 (box drawing vertical) not ASCII |, per §22.1.2.95.

tests look good. you'll want to add one for the no-val case after fixing #1. left inline comments with fixes.

💡 tip: you can look up any ECMA-376 section directly using the ooxml.dev MCP server — handy for checking defaults and edge cases in the spec.


test file: attached .docx with 21 cases covering every m:dPr property. cases 5, 8, 9, 12 show the bugs:
SD-2380-delimiter-spec-tests.docx

Case 5<m:begChr/> should hide the opening delimiter:
SuperDoc:
image
Word:
image

Case 8<m:endChr/> should hide the closing delimiter:
SuperDoc:
image
Word:
image

Case 9 — both present without val, should show no delimiters:
SuperDoc:
image
Word:
image

Case 12<m:sepChr/> should hide the separator:
SuperDoc:
image
Word:
image

@caio-pizzol
Copy link
Copy Markdown
Contributor

@andrewsrigom let me know if you have any questions here! thanks for you work ❤️

@caio-pizzol caio-pizzol self-assigned this Apr 3, 2026
@andrewsrigom
Copy link
Copy Markdown
Contributor Author

Hi @caio-pizzol , this should be ready for another review now. Sorry for the delay, I got caught up with some work on my side. I rechecked the delimiter cases and they now match the expected output

I've noticed a timeout a issue in the pipeline, can you check

@andrewsrigom andrewsrigom requested a review from caio-pizzol April 9, 2026 02:11
Add 5 behavior tests exercising the delimiter converter with a dedicated
test document covering all 21 ECMA-376 §22.1.2.24 compliance cases:
default parentheses, U+2502 separator, suppressed delimiters (chr without
m:val), custom Unicode delimiters (floor, ceiling, abs), and nesting.

Fix stale comment that still referred to delimiter as unimplemented.
Replace map + filter + forEach chain with a single for-loop that
builds expression groups directly, removing the single-use helper.
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.

@andrewsrigom all three items from last round are fixed, looks good.

i pushed two commits — behavior tests with a test document covering all 21 spec cases, and a small refactor inlining createExpressionGroup into a single loop. also added the test doc to our rendering corpus for automatic regression checks.

approving.

@caio-pizzol caio-pizzol enabled auto-merge April 9, 2026 05:21
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 9, 2026
Merged via the queue into superdoc-dev:main with commit 965af10 Apr 9, 2026
47 of 50 checks passed
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 9, 2026

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

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:d delimiter converter (community)

2 participants