From 35020a5fa70d9684cae1a9475ab5b41926eb1f2a Mon Sep 17 00:00:00 2001 From: "@andatoshiki" Date: Sun, 17 Sep 2023 02:02:22 -0700 Subject: [PATCH] fix: remove unused markdown transformation utilities that causes build failure after replacement when calling vue3 as vite plugin --- docs/.vitepress/plugins/markdownTransform.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/.vitepress/plugins/markdownTransform.ts b/docs/.vitepress/plugins/markdownTransform.ts index c1c145f7..cd5c88cf 100644 --- a/docs/.vitepress/plugins/markdownTransform.ts +++ b/docs/.vitepress/plugins/markdownTransform.ts @@ -13,13 +13,16 @@ export function MarkdownTransform(): Plugin { const [_name, i] = id.split('/').slice(-2) // convert img by applying regex - const imgRegex = /!\[(.+?)\]\((.+?)\)/g - let imgMatches = imgRegex.exec(code) - while (imgMatches) { - const [text, link] = imgMatches.slice(1) - code = code.replace(imgMatches[0], `${text || 'img'}`) - imgMatches = imgRegex.exec(code) - } + // const imgRegex = /!\[(.+?)\]\((.+?)\)/g; + // let imgMatches = imgRegex.exec(code); + // while (imgMatches) { + // const [text, link] = imgMatches.slice(1); + // code = code.replace( + // imgMatches[0], + // `${text || ` + // ); + // imgMatches = imgRegex.exec(code); + // } // convert links to components const linkRegex = /\[(.+?)\]\((.+?)\)/g