Skip to content

Conversation

@zorkow
Copy link
Member

@zorkow zorkow commented Dec 4, 2023

Fixes MathJax issue #3120, by checking for the underscore command case.

@zorkow zorkow requested a review from dpvc December 4, 2023 20:36
@zorkow zorkow added this to the v4.0 milestone Dec 4, 2023
Copy link
Member

@dpvc dpvc left a comment

Choose a reason for hiding this comment

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

This fixes \_, but leaves the same potential problem for \^, if one were to be defined similarly to \_.

}
if (node.attributes.get(TexConstant.Attr.LATEX) === '_' && str !== '_') {
if (node.attributes.get(TexConstant.Attr.LATEX) === '_' &&
str !== '_' && str !== '\\_') {
Copy link
Member

Choose a reason for hiding this comment

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

I think you need a similar fix for ^ in line 561 above, in case anyone creates a macro \^ similar to the \_ one.

Copy link
Member Author

Choose a reason for hiding this comment

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

At the moment that can't really happen as latex computation happens after the macro replacement.
But I am not really happy with that anyway, so I've added the case.
PTAL.

Copy link
Member

@dpvc dpvc left a comment

Choose a reason for hiding this comment

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

Thanks for the change. LGTM.

@zorkow zorkow merged commit 53fa26d into develop Feb 1, 2024
@zorkow zorkow deleted the fix/issue_3120 branch February 1, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants