Skip to content

Migrate mixed text/math parsing onto the shared architecture #298

Open

Description

@Happypig375

Migrate mixed text/math parsing onto the shared architecture while preserving the distinct MathList and TextAtom layout responsibilities behind an explicit interoperable boundary.

Scope:

  • Route TextLaTeXParser and math-mode text transitions through the shared token/mode and command layers.
  • Document where mixed content becomes TextAtom versus MathList, including inline and display math spans.
  • Preserve text whitespace, automatic line breaking, and display-math centering.
  • Make token meaning mode-sensitive where LaTeX requires it: a raw _ inside \text{...} is literal text, while raw _ in math mode remains the subscript operator; escaped \_ remains a literal underscore in both supported contexts.
  • Preserve independently consumable Core and frontend packages; do not merge NuGet packages.

Acceptance criteria:

  • One documented pipeline supports math → text → inline/display math → text transitions.
  • Mixed-mode parse/serialize/parse tests cover nested braces, escaped dollars, malformed delimiters, text styles, colors, cases-style expressions, raw/escaped underscores, and outer-subscript/inner-text combinations such as x_\text{_}.
  • Math-mode subscript semantics remain unchanged outside text mode, while \text{_} no longer creates an empty atom with a subscript.
  • Existing Core, Rendering.Text, and rendering suites remain green, including exact error-position tests.
  • The independent scanning/command duplication in TextLaTeXParser is removed or reduced to a clearly documented layout adapter.

Parent epic: #58. This migration follows the shared lexer/mode and command-definition stages and incorporates the behavior established by #205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area/ParsingType/Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions