Skip to content

Comments

fix: disable single-dollar math to prevent currency symbol text corruption#11649

Draft
roomote[bot] wants to merge 1 commit intomainfrom
fix/currency-symbol-text-corruption-11648
Draft

fix: disable single-dollar math to prevent currency symbol text corruption#11649
roomote[bot] wants to merge 1 commit intomainfrom
fix/currency-symbol-text-corruption-11648

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 20, 2026

Related GitHub Issue

Closes: #11648

Description

This PR attempts to address Issue #11648 where currency symbols (R$, US$, $100, etc.) cause text corruption in the markdown renderer. The remark-math plugin was treating single $ as inline math delimiters, causing text between dollar signs to be parsed as LaTeX.

The fix sets singleDollarTextMath: false in the remarkMath plugin config, as suggested by @diovannesn in the issue discussion. This is a 1-line config change that:

  • Prevents single $ from being treated as math delimiters
  • Preserves $$...$$ syntax for both inline and display math
  • Zero preprocessing overhead

The trade-off is that inline math now requires $$x$$ instead of $x$, but $$x$$ renders as inline (not block) math, so functionality is preserved.

Test Procedure

  • Added 3 new test cases to MarkdownBlock.spec.tsx:
    1. Currency symbols (R$100, US$50) render without corruption
    2. Double-dollar math expressions still render as KaTeX
    3. Single dollar signs are not treated as math delimiters
  • All 7 tests pass: cd webview-ui && npx vitest run src/components/common/__tests__/MarkdownBlock.spec.tsx
  • Lint and type checks pass across all packages

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue.
  • Scope: Changes are focused on the linked issue (one config change + tests).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New tests have been added to cover the changes.
  • Documentation Impact: No documentation updates required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

Feedback and guidance are welcome.

Interactively review PR in Roo Code Cloud

…ption

Set singleDollarTextMath: false in remarkMath config so that single $
signs (e.g. R$, US$, $100) are not treated as inline math delimiters.
Math expressions still work with $$ syntax.

Fixes #11648
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.

[BUG] Currency Symbols Cause Text Corruption

1 participant