From 1e07ab1b8dd9a2bafee542ae10eaaa29c11debdb Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 21 Aug 2024 15:29:46 +0300 Subject: [PATCH] docs: fix broken pages due to remark plugin (#8694) * docs: fix broken pages due to remark plugin * refactor condition * Update component-link-fixer.ts --- .../remark-rehype-plugins/src/utils/component-link-fixer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/packages/remark-rehype-plugins/src/utils/component-link-fixer.ts b/www/packages/remark-rehype-plugins/src/utils/component-link-fixer.ts index e1e56ea2fe..2aeae9d963 100644 --- a/www/packages/remark-rehype-plugins/src/utils/component-link-fixer.ts +++ b/www/packages/remark-rehype-plugins/src/utils/component-link-fixer.ts @@ -24,7 +24,7 @@ function matchMdLinks( ) { let linkMatches while ((linkMatches = MD_LINK_REGEX.exec(str)) !== null) { - if (!linkMatches.groups?.link) { + if (!linkMatches.groups?.link || linkMatches.groups?.link.startsWith("http")) { return } @@ -43,7 +43,7 @@ function matchValueLink( str: string, linkOptions: Omit ) { - if (!VALUE_LINK_REGEX.exec(str)) { + if (!VALUE_LINK_REGEX.exec(str) || str.startsWith("http")) { return str }