-
Notifications
You must be signed in to change notification settings - Fork 214
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
Ignore * in \\* and \\*[...] constructions. (mathjax/MathJax#2433) #637
Conversation
PS, change the settings to ignore white-space changes for easier viewing. |
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.
Can you please add a TODO
note reflecting my comment?
if (!nobrackets) { | ||
if (parser.string.charAt(parser.i) === '*') { // The * controls page breaking, so ignore it | ||
parser.i++; | ||
} |
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.
I assume GetStar
would not work as it ignores spaces.
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.
Yes, the direct check rather than getStar()
was to not ignore spaces.
if (parser.string.charAt(parser.i) === '*') { // The * controls page breaking, so ignore it | ||
parser.i++; | ||
} | ||
if (parser.string.charAt(parser.i) === '[') { |
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.
This treatment has always been slightly problematic. Our newline is used in math array structures, so spaces after \\
would actually have to be treated accordingly. That is, the current treatment is correct for AMS environments but should be ignored in array
and eqnarray
.
In MJ2 base and AMS arrays were treated the same, so this could not really be resolved. However, now they are separated, so we could do that.
But it's not for this PR to resolve this. Just pointing out that this is an issue waiting to happen.
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.
OK, good to know. I wasn't aware of the distinction. We can keep it in mind, as you say.
Done. |
This PR causes the
\\
command to ignore a following asterisk, if there is one. (The asterisk is for controlling page breaks, but it makes sense for MathJax to just ignore it.)Resolves issue mathjax/MathJax#2433.