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

Ignore * in \\* and \\*[...] constructions. (mathjax/MathJax#2433) #637

Merged
merged 2 commits into from
Mar 19, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 18, 2021

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.

@dpvc
Copy link
Member Author

dpvc commented Mar 18, 2021

PS, change the settings to ignore white-space changes for easier viewing.

@dpvc dpvc requested a review from zorkow March 18, 2021 17:31
@dpvc dpvc added this to the 3.1.3 milestone Mar 18, 2021
Copy link
Member

@zorkow zorkow left a 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++;
}
Copy link
Member

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.

Copy link
Member Author

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) === '[') {
Copy link
Member

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.

Copy link
Member Author

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.

@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

Can you please add a TODO note reflecting my comment?

Done.

@dpvc dpvc merged commit 428fe6a into develop Mar 19, 2021
@dpvc dpvc deleted the issue2433 branch March 19, 2021 18:34
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.

None yet

2 participants