Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue https://github.com/mathjax/MathJax/issues/3120 #1028

Merged
merged 2 commits into from
Feb 1, 2024

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 \_.

@@ -572,7 +572,8 @@ export default class TexParser {
}
return;
}
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.

2 participants