Skip to content

Incorrect data-latex attribute for multi-digit numeric subscripts #3459

@gelprec

Description

@gelprec

Issue Summary

For multi-digit numeric subscripts, the data-latex attribute fails to match the subscript value correctly, causing the first digit to be ignored. This issue does not occur with symbolic subscripts. Tested on the latest Mathjax v4

Steps to Reproduce:

  1. Open the MathJax live demo
  2. Enter
    $a_{123}$
    
  3. Analyze the corresponding HTML output in the browser's developer console. You will see something like the following:
    <mjx-texatom data-latex="{23}"...>...</mjx-texatom>
    

Expected Behavior

I expect something like the following:

<mjx-texatom data-latex="{123}"...>...</mjx-texatom>

Technical details:

  • MathJax Version: 4.0
  • Client OS: Windows 11
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    AcceptedIssue has been reproduced by MathJax teamCode ExampleContains an illustrative code example, solution, or work-aroundReady for Reviewv4

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions