Skip to content

Math: implement m:sSub subscript converter (community) #2596

@caio-pizzol

Description

@caio-pizzol

What

Implement the m:sSub (subscript) OMML → MathML converter.

OMML: m:sSubm:e (base) + m:sub (subscript)
MathML: <msub> with two children (base, subscript)
Spec: §22.1.2.101
Difficulty: Easy

Example

Word: a₁ → <m:sSub><m:e><m:r><m:t>a</m:t></m:r></m:e><m:sub><m:r><m:t>1</m:t></m:r></m:sub></m:sSub>
MathML: <msub><mi>a</mi><mn>1</mn></msub>

How to implement

  1. Create packages/layout-engine/painters/dom/src/features/math/converters/subscript.ts
  2. Export convertSubscript: MathObjectConverter
  3. Register in converters/index.ts and omml-to-mathml.ts registry ('m:sSub': convertSubscript)

See converters/fraction.ts for the pattern.

Test Document

Download the test file and upload it to the SuperDoc dev app to verify your implementation renders correctly:

sd-2373-subscript.docx


Want to work on this? Check the Contributing Guide to get started. Comment on this issue to let us know you're picking it up.

Ref: SD-2373

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions