-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[BUG]: Youtube Extension: pasting "https://youtube.com" is considered a valid youtube link #4560
Closed
1 of 2 tasks
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Comments
hadielyakhni
added
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
labels
Oct 24, 2023
hadielyakhni
changed the title
Youtube Extension: pasting "https://youtube.com" is considered a valid youtube link
[BUG]: Youtube Extension: pasting "https://youtube.com" is considered a valid youtube link
Oct 24, 2023
C-Hess
added a commit
to C-Hess/tiptap
that referenced
this issue
Oct 30, 2023
4 tasks
4 tasks
janthurau
added a commit
that referenced
this issue
Nov 20, 2023
janthurau
added a commit
that referenced
this issue
Nov 20, 2023
bdbch
added a commit
that referenced
this issue
Dec 5, 2024
#4645) * replaced youtube regex with regex found on https://regexr.com/3dj5t, fixes #4560 * adds support for music. subdomain * Create dry-ghosts-wash.md --------- Co-authored-by: bdbch <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Which packages did you experience the bug in?
@tiptap/extension-youtube
What Tiptap version are you using?
2.1.12
What’s the bug you are facing?
We are using the YouTube extension in our React application.
When pasting the string
https://youtube.com
, it will be matched by the paste rule, however, when rendering the iframe, getEmbedUrlFromYoutubeUrl returnsnull
since the stringhttps://youtube.com
does not contain a proper src, hence the iframe is rendered without asrc
attribute, aka as an empty iframe. Please note that till this point, nothing crashes, it's just an empty iframe.However, this behavior will cause a crash in our application because we persist the content, so when the user refreshes the browser, parseHtml will not be able to find the
src
attribute, hence, renderHtml will passnull
to getEmbedUrlFromYoutubeUrl, crashing the browser with the following error: "cannot read property of null".What browser are you using?
Chrome
Code example
https://codesandbox.io/s/reverent-star-ps5wc8?file=/src/App.js
What did you expect to happen?
YOUTUBE_REGEX_GLOBAL
not matching the stringhttps://youtube.com
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: