{{ message }}
Repository navigation
fix(desktop): tell the two backslash math preferences apart in the UI (#5481) - #5485
Merged
Merged
Conversation
…#5481) Their labels differed only by backslash count — "TeX math with \( and \[" vs "TeX math with \\( and \\[" — and vue-i18n's message compiler reads `\\` as an escaped backslash and collapses it to one. Both rendered as "TeX math with \( and \[", so Preferences → Markdown → Extensions showed two identical switches. Getting the escaping right would take eight backslashes in the JSON to display two: invisible on review, and the next translator or formatting pass silently breaks it back to this exact symptom. The labels now say it in words instead. The `more` link on each switch already points at pandoc's manual for the delimiters themselves. A locale check enforces the rule: values here are plain labels, never templates that need escaping, so none of them may contain a backslash. It covers en.json too, which the comparison checks around it deliberately skip. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
4 tasks done
Contributor
|
Build artifacts for PR #5485: Run: https://github.com/marktext/marktext/actions/runs/35587596889 |
Wangqkoe
pushed a commit
to Wangqkoe/marktext
that referenced
this pull request
Oct 21, 2026
…marktext#5481) (marktext#5485) Their labels differed only by backslash count — "TeX math with \( and \[" vs "TeX math with \\( and \\[" — and vue-i18n's message compiler reads `\\` as an escaped backslash and collapses it to one. Both rendered as "TeX math with \( and \[", so Preferences → Markdown → Extensions showed two identical switches. Getting the escaping right would take eight backslashes in the JSON to display two: invisible on review, and the next translator or formatting pass silently breaks it back to this exact symptom. The labels now say it in words instead. The `more` link on each switch already points at pandoc's manual for the delimiters themselves. A locale check enforces the rule: values here are plain labels, never templates that need escaping, so none of them may contain a backslash. It covers en.json too, which the comparison checks around it deliberately skip. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 7d862bf)
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.

Follow-up to #5481.
Preferences → Markdown → Extensions shows the two backslash math switches with
the same label. Their strings differ only by backslash count —
"TeX math with \\( and \\["vs"TeX math with \\\\( and \\\\["in the JSON —and vue-i18n's message compiler reads
\\as an escaped backslash and collapsesit to one. Both render as
TeX math with \( and \[.Why not just escape it
To display
\\(the JSON would need eight backslashes. That is invisible onreview, meaningless to a translator, and the next formatting pass silently
restores this exact symptom. The labels now say it in words instead; the
morelink on each switch already points at pandoc's manual for the delimiters
themselves.
texMathSingleBackslashtexMathDoubleBackslashAll eleven locales updated. The long
preferences.search.itemsstrings areuntouched — they name the pandoc extension and have no backslashes to lose.
The check
Values in these files are plain labels, never templates that need escaping, so
locale-validation.spec.tsnow rejects a backslash anywhere in a translatedvalue. It covers
en.json, which the comparison checks around it deliberatelyskip — the first version of the check did not, and passed while the bug was
still there.
Test plan
pnpm run test:unit—locale-validation.spec.tsat 46 casespnpm run lintandpnpm run typechecksafeMessageCompilertoconfirm they now differ
en.jsonfails the newcheck and names the offending key
🤖 Generated with Claude Code