Markdown Rendering: Triple Dollar Signs Lost When Copying ast-grep Patterns

Resolved 💬 3 comments Opened Jun 21, 2025 by liby Closed Jan 4, 2026

Bug Description
Markdown rendering issue: Triple dollar signs ($$$) in ast-grep patterns are copied as
double dollar signs ($$)

When viewing _CLAUDE.md_ instructions that contain ast-grep patterns with triple dollar signs
($$$), the rendered Markdown shows them correctly, but when copying the text, they become double
dollar signs ($$).

Example:

  • Original in _CLAUDE.md_: ast-grep --lang tsx -p 'useEffect($$$)'

<img width="811" alt="Image" src="https://github.com/user-attachments/assets/aff69082-ba86-47e4-b53c-f8d8f16e82ed" />

  • After copying: ast-grep --lang tsx -p 'useEffect($$)'

<img width="912" alt="Image" src="https://github.com/user-attachments/assets/b1ea8265-4f29-47c7-bdaf-ba439202eb84" />

This affects all ast-grep pattern examples in the CLI Tools section. The $$$ metacharacter is
important in ast-grep as it matches zero or more arguments/expressions.

Expected behavior: Copied text should preserve the original triple dollar signs.
Actual behavior: One dollar sign is lost during copy operation.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 1.0.31
  • Feedback ID: 3afa4e52-d1d3-4fb8-a770-24149486d8a8

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗