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

Skip TeX comments correctly. mathjax/MathJax#2271. #413

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Dec 26, 2019

Update FindTeX to properly skip comments, even if they include unbalanced braces.

Resolves issue mathjax/MathJax#2271

@dpvc dpvc requested a review from zorkow December 26, 2019 20:39
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.

lgtm.

@dpvc
Copy link
Member Author

dpvc commented Jan 3, 2020

This is potentially a breaking change, so I am not going to include it in this version. The problem is that

... $$ x + y % comment $$ ...

would be processed by the current version (and version 2), but would not be processed by this PR, since the second $$ is now part of a comment. Although the behavior of this PR is the correct one for LaTeX, it might break existing content that takes advantage of this error in processing.

@dpvc
Copy link
Member Author

dpvc commented Jan 3, 2020

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,

\def\xyz#1%#2{[#1][#2]}

is valid, and can be used via \xyz a%b to get [a][b] as output. This is not how actual LaTeX works, and so this should be fixed as well. But I know that this is used on the Puzzling StackExchange site in some MathJax-based puzzles, and it will break those.

So I'm wondering if it is better to leave it as is, or break those incorrect (but useful) usages?

@dpvc dpvc marked this pull request as draft March 11, 2023 21:25
@dpvc dpvc force-pushed the develop branch 3 times, most recently from b77df61 to 1f851dd Compare April 25, 2024 16:21
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