Socket
Socket
Sign inDemoInstall

@tiptap/extension-youtube

Package Overview
Dependencies
Maintainers
4
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.12 to 2.1.13

7

dist/index.js
import { Node, nodePasteRule, mergeAttributes } from '@tiptap/core';
const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/;
const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/g;
const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/;
const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g;
const isValidYoutubeUrl = (url) => {

@@ -13,2 +13,5 @@ return url.match(YOUTUBE_REGEX);

const { url, allowFullscreen, autoplay, ccLanguage, ccLoadPolicy, controls, disableKBcontrols, enableIFrameApi, endTime, interfaceLanguage, ivLoadPolicy, loop, modestBranding, nocookie, origin, playlist, progressBarColor, startAt, } = options;
if (!isValidYoutubeUrl(url)) {
return null;
}
// if is already an embed url, return it

@@ -15,0 +18,0 @@ if (url.includes('/embed/')) {

@@ -7,4 +7,4 @@ (function (global, factory) {

const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/;
const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/g;
const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/;
const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g;
const isValidYoutubeUrl = (url) => {

@@ -18,2 +18,5 @@ return url.match(YOUTUBE_REGEX);

const { url, allowFullscreen, autoplay, ccLanguage, ccLoadPolicy, controls, disableKBcontrols, enableIFrameApi, endTime, interfaceLanguage, ivLoadPolicy, loop, modestBranding, nocookie, origin, playlist, progressBarColor, startAt, } = options;
if (!isValidYoutubeUrl(url)) {
return null;
}
// if is already an embed url, return it

@@ -20,0 +23,0 @@ if (url.includes('/embed/')) {

{
"name": "@tiptap/extension-youtube",
"description": "a youtube embed extension for tiptap",
"version": "2.1.12",
"version": "2.1.13",
"homepage": "https://tiptap.dev",

@@ -32,3 +32,3 @@ "keywords": [

"devDependencies": {
"@tiptap/core": "^2.1.12"
"@tiptap/core": "^2.1.13"
},

@@ -35,0 +35,0 @@ "peerDependencies": {

@@ -1,3 +0,3 @@

export const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/
export const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)(?!.*\/channel\/)(?!\/@)(.+)?$/g
export const YOUTUBE_REGEX = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/
export const YOUTUBE_REGEX_GLOBAL = /^(https?:\/\/)?(www\.|music\.)?(youtube\.com|youtu\.be)\/(?!channel\/)(?!@)(.+)?$/g

@@ -55,2 +55,6 @@ export const isValidYoutubeUrl = (url: string) => {

if (!isValidYoutubeUrl(url)) {
return null
}
// if is already an embed url, return it

@@ -57,0 +61,0 @@ if (url.includes('/embed/')) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc