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-react] Feature: add attributes in LinkPlugin #6760

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

taro-shono
Copy link
Contributor

Description

Add attributes when pasting a link into a text.

Test plan

Before

Can not add target

Screen.Shot.2024-10-25.at.16.18.09.mp4

After

Can add target

Screen.Shot.2024-10-25.at.16.18.49.mp4

Copy link

vercel bot commented Oct 25, 2024

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 Oct 25, 2024 3:06pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 3:06pm

@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 Oct 25, 2024
Copy link

github-actions bot commented Oct 25, 2024

size-limit report 📦

Path Size
lexical - cjs 29.94 KB (0%)
lexical - esm 29.78 KB (0%)
@lexical/rich-text - cjs 38.6 KB (0%)
@lexical/rich-text - esm 31.64 KB (0%)
@lexical/plain-text - cjs 37.2 KB (0%)
@lexical/plain-text - esm 29 KB (0%)
@lexical/react - cjs 40.34 KB (0%)
@lexical/react - esm 33 KB (0%)

@potatowagon
Copy link
Contributor

code lgtm, can we have some tests please to check that attributes are added to link on paste?

...attributes,
rel,
target,
title,
Copy link
Contributor

Choose a reason for hiding this comment

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

this means that the link attribute contents of payload will overwrite the contents of attributes

potatowagon
potatowagon previously approved these changes Oct 25, 2024
@taro-shono
Copy link
Contributor Author

@potatowagon I have added a test, so please check it out.

potatowagon
potatowagon previously approved these changes Oct 25, 2024
@potatowagon
Copy link
Contributor

thanks for this!

@potatowagon potatowagon added this pull request to the merge queue Oct 25, 2024
Merged via the queue into facebook:main with commit d64d395 Oct 25, 2024
40 checks passed
@taro-shono taro-shono deleted the feat-link-plugin branch October 25, 2024 22:37
@aleksey-pro
Copy link

aleksey-pro commented Nov 1, 2024

Thanks for the plugin. But if i switch off attributes after link is created - it doesn't removes target="__blank" atribute from node.

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.

4 participants