editor: fix false "used inside existing math mode" warning for \tag*#1495
Open
MarkQuach12 wants to merge 6 commits into
Open
editor: fix false "used inside existing math mode" warning for \tag*#1495MarkQuach12 wants to merge 6 commits into
MarkQuach12 wants to merge 6 commits into
Conversation
Add sample kind setup
\tag*{...} (amsmath's unnumbered tag) incorrectly triggered an "open
inline math \( used inside existing math mode" warning when its
argument contained inline math, e.g. \tag*{\(\dagger\)} or
\tag*{$abc$}. \tag{...} without the star already worked.
The linter marks \tag's argument group as text-mode so nested math
delimiters are allowed, but the literal * between \tag and { was
tokenized separately and reset that flag before the argument group
was reached. \tag now consumes an immediately following * so the
text-mode flag survives to the argument group.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a linter false positive where
\tag*{...}(amsmath's unnumbered tag) incorrectly triggered an "open inline math ( used inside existing math mode" warning when its argument contained inline math, e.g.\tag*{\(\dagger\)}or\tag*{$abc$}. The plain\tag{...}form already worked correctly.Root cause: the linter marks
\tag's argument group as text-mode so nested math delimiters are allowed, but the literal*character between\tagand{was being treated as its own token and reset that text-mode flag before the argument group was reached. The fix has\tagconsume an immediately following*so the text-mode flag survives to the argument group.Related issues / Pull Requests
#1255
Contributor Agreement