From 829ffab5fd4664bfdbe3e18dd25229ac3591c68b Mon Sep 17 00:00:00 2001 From: Mike Huang Date: Wed, 3 Jan 2024 21:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20better=20note=20block=20parse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/transform-markdown.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/transform-markdown.ts b/utils/transform-markdown.ts index e0cd1d034c..c1a2deb81e 100644 --- a/utils/transform-markdown.ts +++ b/utils/transform-markdown.ts @@ -44,7 +44,7 @@ export const transformMarkdown = (content: string, slug: string) => .replace(//, ``) // {% note %} 轉換 .replace( - /

{% note (.*?) %}<\/p>(.*?)

{% endnote %}<\/p>/gs, + /

\s*{% note (.*?) %}\s*<\/p>(.*?)

\s*{% endnote %}\s*<\/p>/gs, (match, noteClass, content) => { const newContent = content.trim().replace(/^\s+|\s+$/g, ''); return `

${newContent}

`;