From 1a1e1b56ee7f2c767166fcfbd3d7f3d9740d7a82 Mon Sep 17 00:00:00 2001 From: Nicolas Froidure Date: Thu, 22 Dec 2022 17:34:38 +0100 Subject: [PATCH] fix(utils): fix markdown parsing --- src/utils/markdown.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/markdown.tsx b/src/utils/markdown.tsx index 28830811..f5aa03f1 100644 --- a/src/utils/markdown.tsx +++ b/src/utils/markdown.tsx @@ -265,7 +265,7 @@ const blockquoteMap: NodeToElementMapper = ( ); const imageMap: NodeToElementMapper = (context, node) => { - const finalTitle = (node.title || "").replace(/^🖼(➡️|⬅️)\s*/, ""); + const finalTitle = (node.title || "").replace(/^🖼(➡️|⬅️)\s*/u, ""); return ( @@ -325,7 +325,7 @@ const imageMap: NodeToElementMapper = (context, node) => { const hyperlinkMap: NodeToElementMapper = (context, node) => { const youtubeURL = parseYouTubeURL(node.url); - return node?.title.startsWith("🎧") ? ( + return node?.title?.startsWith("🎧") ? (