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

[lexical-link] Bug Fix: Remove anchors with empty href during DOM import #7227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrdivyansh
Copy link
Contributor

Description

Currently, LinkNode allows importing DOM with an empty href. However, IMO, it doesn't make sense during HTML paste.

Test plan

Before

Screen.Recording.2025-02-22.at.12.14.11.AM.mov

After

Screen.Recording.2025-02-22.at.12.12.47.AM.mov

Copy link

vercel bot commented Feb 21, 2025

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 Feb 21, 2025 6:47pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 6:47pm

@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 Feb 21, 2025
Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

I'm not sure this is the best place to encode this normalization, it's easy enough to do this in editor html.import configuration or with a LinkNode transform if it's something that's appropriate for your editor. It looks like this was an intentional decision to allow empty links rather than to normalize them away #3194

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.

3 participants