- Notifications
You must be signed in to change notification settings - Fork225
Skip TeX comments correctly. mathjax/MathJax#2271.#413
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:develop
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…nced braces. Resolves issuemathjax/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 |
dpvc commentedJan 3, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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
to1f851dd
CompareThere 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.
Replacesubstr
.
@@ -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
}elseif(match[0].substr(0)==='%'){ | |
}elseif(match[0].substring(0)==='%'){ |
Update
FindTeX
to properly skip comments, even if they include unbalanced braces.Resolves issuemathjax/MathJax#2271