mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
Check if url exists (#3484)
This commit is contained in:
parent
8b854b67a4
commit
14fb467bc8
@ -23,11 +23,13 @@ const MenuBar = ({ editor }) => {
|
||||
const addYoutubeVideo = () => {
|
||||
const url = prompt('Enter YouTube URL')
|
||||
|
||||
editor.commands.setYoutubeVideo({
|
||||
src: url,
|
||||
width: Math.max(320, parseInt(widthRef.current.value, 10)) || 640,
|
||||
height: Math.max(180, parseInt(heightRef.current.value, 10)) || 480,
|
||||
})
|
||||
if (url) {
|
||||
editor.commands.setYoutubeVideo({
|
||||
src: url,
|
||||
width: Math.max(320, parseInt(widthRef.current.value, 10)) || 640,
|
||||
height: Math.max(180, parseInt(heightRef.current.value, 10)) || 480,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user