-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Skip TeX comments correctly. mathjax/MathJax#2271. #413
base: develop
Are you sure you want to change the base?
Conversation
…nced braces. Resolves issue mathjax/MathJax#2271
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
This is potentially a breaking change, so I am not going to include it in this version. The problem is that
would be processed by the current version (and version 2), but would not be processed by this PR, since the second |
There should also be additional changes to actually remove all comments before processing the rest of the expression, as currently that is not being done. For example,
is valid, and can be used via So I'm wondering if it is better to leave it as is, or break those incorrect (but useful) usages? |
b77df61
to
1f851dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace substr
.
@@ -180,6 +180,8 @@ export class FindTeX<N, T, D> extends AbstractFindMath<N, T, D> { | |||
braces++; | |||
} else if (match[0] === '}' && braces) { | |||
braces--; | |||
} else if (match[0].substr(0) === '%') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
substr
is deprecated
} else if (match[0].substr(0) === '%') { | |
} else if (match[0].substring(0) === '%') { |
Update
FindTeX
to properly skip comments, even if they include unbalanced braces.Resolves issue mathjax/MathJax#2271