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(lexical): Text with underline format is stripped out on paste #2555

Merged

Conversation

LuciNyan
Copy link
Contributor

@LuciNyan LuciNyan commented Jun 29, 2022

Description

function convertSpanElement does not handle text-decoration: underline

closes #2552

2022-06-29.2.25.20.mov

@vercel
Copy link

vercel bot commented Jun 29, 2022

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

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jun 29, 2022 at 7:22AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 29, 2022 at 7:22AM (UTC)

@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 Jun 29, 2022
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.

Thanks Luci!

Comment on lines +852 to +854
if ($isTextNode(lexicalNode) && hasUnderlineTextDecoration) {
lexicalNode.toggleFormat('underline');
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit; mind adding an early return at the top, would be faster than reevaluating this 4 times

if (!$isTextNode(lexicalNode)) {
  return;
}

@zurfyx
Copy link
Member

zurfyx commented Jun 29, 2022

Feel free to follow up on another PR, going to close 0.3.6 now

@zurfyx zurfyx merged commit a063cc6 into facebook:main Jun 29, 2022
@LuciNyan LuciNyan deleted the fix-underline-format-is-stripped-out-on-paste branch August 5, 2022 00:58
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
Development

Successfully merging this pull request may close these issues.

Bug: Text with 'underline' format is stripped out on paste
3 participants