Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exportTextFormat to keep dollar sign #5379

Merged
merged 5 commits into from Jan 17, 2024

Conversation

2wheeh
Copy link
Contributor

@2wheeh 2wheeh commented Dec 12, 2023

Fixes #5319
Fixes #4931

Currently we uses String.replace() in exportTextFormat:

function exportTextFormat(...) {
// ...
  return textContent.replace(frozenString, output);
}

The issue happens when output has $&, $$, ....
It is because there are special replacement sequences beginning with $:
image

A workaround for this: https://stackoverflow.com/questions/9423722/string-replace-weird-behavior-when-using-dollar-sign-as-replacement

before:

before.mov

after:

after.mov

Copy link

vercel bot commented Dec 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2023 7:20am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2023 7:20am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 12, 2023
Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for the fix!

@zurfyx zurfyx merged commit a89223e into facebook:main Jan 17, 2024
45 checks passed
@2wheeh 2wheeh deleted the no-strip-dollar-sign branch January 17, 2024 16:32
amanharwara pushed a commit to standardnotes/lexical that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
3 participants