Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
dpvc wants to merge2 commits intodevelop
base:develop
Choose a base branch
Loading
fromissue2271

Conversation

dpvc
Copy link
Member

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

Resolves issuemathjax/MathJax#2271

@dpvcdpvc requested a review fromzorkowDecember 26, 2019 20:39
Copy link
Member

@zorkowzorkow 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
MemberAuthor

dpvc commentedJan 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
MemberAuthor

dpvc commentedJan 3, 2020
edited
Loading

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?

@dpvcdpvc marked this pull request as draftMarch 11, 2023 21:25
@dpvcdpvcforce-pushed thedevelop branch 3 times, most recently fromb77df61 to1f851ddCompareApril 25, 2024 16:21
Copy link
Member

@zorkowzorkow left a 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) === '%') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

substr is deprecated

Suggested change
}elseif(match[0].substr(0)==='%'){
}elseif(match[0].substring(0)==='%'){

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@zorkowzorkowzorkow requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@dpvc@zorkow

[8]ページ先頭

©2009-2025 Movatter.jp