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

Youtube link detection failed #23

Closed
anuraghazra opened this issue Oct 10, 2019 · 6 comments
Closed

Youtube link detection failed #23

anuraghazra opened this issue Oct 10, 2019 · 6 comments
Labels
🐛 Bug Something isn't working released 👷 Someone Working on It ⚙️ YouTube Issue or pull request regarding YouTube

Comments

@anuraghazra
Copy link
Contributor

  • gatsby-remark-embedder version: 1.3.1

What you did:
trying to embed youtube video with www.youtube.com

What happened:
did not embed

Problem description:
https://youtube.com/watch?v=dQw4w9WgXcQ is embedding correctly but https://www.youtube.com/watch?v=dQw4w9WgXcQ is not

Suggested solution:
Fixing shouldTransform function

@MichaelDeBoey MichaelDeBoey added the 🐛 Bug Something isn't working label Oct 10, 2019
@anuraghazra
Copy link
Contributor Author

looks like using === is causing the issue because it doesn't take account on www

  return (
    host === 'youtu.be' ||
    (host === 'youtube.com' &&
      pathname.includes('/watch') &&
      Boolean(searchParams.get('v')))
  );

@MichaelDeBoey
Copy link
Owner

Hi @anuraghazra!

Thanks for bringing this to my attention.
Will push a fix asap. 🙂

@MichaelDeBoey
Copy link
Owner

@allcontributors Please add @anuraghazra for bugs

@allcontributors
Copy link
Contributor

@MichaelDeBoey

I've put up a pull request to add @anuraghazra! 🎉

@anuraghazra
Copy link
Contributor Author

so basically all new URL(url).host === "my url" checks will be failing in this case

@MichaelDeBoey
Copy link
Owner

🎉 This issue has been resolved in version 1.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@MichaelDeBoey MichaelDeBoey added released ⚙️ YouTube Issue or pull request regarding YouTube labels Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working released 👷 Someone Working on It ⚙️ YouTube Issue or pull request regarding YouTube
Projects
None yet
Development

No branches or pull requests

2 participants