From cb3c903d7b03e862e94774655ae52c971c7818bb Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Sun, 26 Dec 2021 13:43:45 +0100 Subject: [PATCH] [blog][bug] fix parseMarkdown skipping paragraphs with html tags --- src/parseMarkdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parseMarkdown.js b/src/parseMarkdown.js index 441d10ec4..fdd2be887 100644 --- a/src/parseMarkdown.js +++ b/src/parseMarkdown.js @@ -14,7 +14,8 @@ export default async function parseMarkdown(markdown) { const imgMatch = content.match(']*>'); const img = imgMatch ? imgMatch[1] : null; let intro = []; - for (let introMatch of content.matchAll(']*>([^<]+)

')) { + + for (let introMatch of content.matchAll(/]*>(.+?)<\/p>/gms)) { const p = introMatch[1].replace(/(<([^>]+)>)/ig, '').replace(/\s+/g, ' '); intro = [...intro, ...p.split(' ')]; }