Darginec05 / Yoopta-Editor

Build Notion-like, Craft-like, Coda-like, Medium-like editors with Yoopta
https://yoopta.dev/
MIT License
1.18k stars 91 forks source link

[BUG] Can't embed x.com post #165

Closed penghuili closed 4 months ago

penghuili commented 4 months ago

Has this bug been raised before?

Description

Hi, one question about x.com post.

Now the X/Twitter domain becomes x.com everywhere, and when people clicks the "Copy link" of a post, they get a x.com link, not twitter.com anymore.

But the embed plug still only checks twitter: https://github.com/Darginec05/Yoopta-Editor/blob/v4.3.1/packages/plugins/embed/src/utils/providers.ts#L34

Should we also check for x.com?

Thank you!

Steps to Reproduce

  1. Go to x.com;
  2. Copy the link of a post through the share icon -> "Copy link";
  3. You get a x.com link;
  4. Add this link to an editor through the embed plugin;
  5. You get this: Screenshot 2024-05-18 204117

Environment

Screenshots

See "Steps to Reproduce"

Do you want to work on this issue?

Yes

If "yes" to above, please explain how you would technically implement this

Check both "twitter" and "x.com" here to decide it's a X post or not: https://github.com/Darginec05/Yoopta-Editor/blob/v4.3.1/packages/plugins/embed/src/utils/providers.ts#L34

Darginec05 commented 4 months ago

Oh yes, now all domains with name "twitter" have been moved to x.com. Do you want to start working on it?

penghuili commented 4 months ago

Oh yes, now all domains with name "twitter" have been moved to x.com. Do you want to start working on it?

Sure, I will give it a try today.


Created: https://github.com/Darginec05/Yoopta-Editor/pull/167

Darginec05 commented 4 months ago

Fixed in @v4.3.2 thanks to @penghuili 🔥