From 7be3af4075a5baf0cc21daf1bb1e8202c9651b2c Mon Sep 17 00:00:00 2001 From: liaojiqing2012 Date: Thu, 12 Dec 2024 15:59:50 +0800 Subject: [PATCH] Update markdown-it-media.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决了多个pdf显示不全的问题 --- packages/ui-default/backendlib/markdown-it-media.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui-default/backendlib/markdown-it-media.ts b/packages/ui-default/backendlib/markdown-it-media.ts index b6684467d..98a1e85dc 100644 --- a/packages/ui-default/backendlib/markdown-it-media.ts +++ b/packages/ui-default/backendlib/markdown-it-media.ts @@ -26,7 +26,7 @@ function preziParser(url: string) { const match = url.match(preziRegex); return match ? match[1] : url; } -const EMBED_REGEX = /@\[([a-zA-Z].+?)]\((.*?)[)]/im; +const EMBED_REGEX = /@\[([a-zA-Z]+)\]\((.*?)\)/; function extractVideoParameters(url: string) { const parameterMap = new Map(); const params = url.replace(/&/gi, '&').split(/[#?&]/); @@ -150,7 +150,7 @@ export function Media(md: MarkdownIt) { token.attrPush(['url', match[2]]); token.level = theState.level; } - theState.pos += theState.src.indexOf(')', theState.pos); + theState.pos += match[0].length-1; return true; }); }