From 4c071a557300de451bd367097950ee943890cb95 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Fri, 1 Apr 2022 15:02:43 +0800 Subject: [PATCH] fix: ?<= not work at safari --- packages/client/src/tiptap/services/markdown/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/tiptap/services/markdown/index.tsx b/packages/client/src/tiptap/services/markdown/index.tsx index eea2412a..393ab3af 100644 --- a/packages/client/src/tiptap/services/markdown/index.tsx +++ b/packages/client/src/tiptap/services/markdown/index.tsx @@ -18,9 +18,9 @@ export * from './markdown-source-map'; const extractImage = (html) => { let matches = []; - while ((matches = html.match(/(?<=\)\(?=\<\/p\>)/g))) { - const source = html.match(/\\\<\/p\>/g)[0]; - html = html.replace(source, matches[0]); + while ((matches = html.match(/\\\<\/p\>/g))) { + const target = matches[0].match(//)[0]; + html = html.replace(matches[0], target); } return html;