From eb813e2b9350fc94d54005cb13fb2f1da198ea36 Mon Sep 17 00:00:00 2001 From: 0xkg Date: Wed, 12 Mar 2025 20:35:18 +0300 Subject: [PATCH] fix: fix regex to support both quote types in `href` --- utils/breadcrumbs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/breadcrumbs.ts b/utils/breadcrumbs.ts index 921655513..c9ba3dabe 100644 --- a/utils/breadcrumbs.ts +++ b/utils/breadcrumbs.ts @@ -81,7 +81,7 @@ async function getContentFiles(folderPath: string): Promise { async function getBreadcrumbCards(breadcrumbPath: string): Promise> { try { const content = await fs.promises.readFile(breadcrumbPath, 'utf-8'); - const cardMatches = content.match(/]*href="([^"]+)"[^>]*>/g) || []; + const cardMatches = content.match(/]*href=['"]([^'"]+)['"][^>]*>/g) || []; return new Set( cardMatches.map(match => { const hrefMatch = match.match(/href="([^"]+)"/);