fix: Use more strict youtube id regex

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-08-25 19:09:38 +02:00
parent 95228c5d19
commit 56744db3a2
4 changed files with 24 additions and 4 deletions

View file

@ -9,7 +9,7 @@ import { YoutubeMarkdownExtension } from './youtube-markdown-extension'
import markdownItRegex from 'markdown-it-regex'
import type MarkdownIt from 'markdown-it'
export const legacyYouTubeRegex = /^{%youtube ([^"&?\\/\s]{11}) ?%}$/
export const legacyYouTubeRegex = /^{%youtube\s+([\w-]{11})\s*%}$/
/**
* Configure the given {@link MarkdownIt} to render legacy hedgedoc 1 youtube short codes as embeddings.