Skip to content

fix(clipboard): copy text without escapes that it does not need - #9

Open
g4lb wants to merge 1 commit into
usememos:mainfrom
g4lb:copy-plain-dollar
Open

g4lb wants to merge 1 commit into
usememos:mainfrom
g4lb:copy-plain-dollar

Conversation

@g4lb

@g4lb g4lb commented Nov 30, 2026

Copy link
Copy Markdown

Fixes usememos/memos#6683.

Copied text/plain was the saved Markdown, so a $ that the math syntax escapes pasted as \$:

shown:  rm -rf $(brew --cache)
copied: rm -rf \$(brew --cache)

Now text/plain leaves out each extension escape that the content reads back the same without (copyMarkdown). The HTML still carries the saved Markdown, so a paste into the editor and the saved Markdown do not change. If a paragraph reads back different without the escapes (a $x$ b), its copy keeps all of them.

Checks:

  • npm test passes (10121), with a new test in dialect.test.ts.
  • npm run typecheck and npm run build pass.
  • In the playground (Chrome), rm -rf $(brew --cache), echo $HOME $PATH and costs $5 and $10 copy as typed. The HTML keeps \$.
  • I did not run npm run test:e2e.

Copied text/plain was the saved Markdown, so a "$" that the math
syntax escapes pasted as "\$": rm -rf \$(brew --cache) in a terminal.

text/plain now leaves out each extension escape that the content reads
back the same without. The HTML still carries the saved Markdown, so a
paste into the editor does not change.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a80d478d-bd19-4441-8bd9-22cacbc105c6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

Copying memo text adds a backslash before the dollar sign in both edit and read modes

1 participant