From 3d783752044ec6ce8e6921ffe56e421af7a46c69 Mon Sep 17 00:00:00 2001 From: Clarence Dan <48417261+ClarenceDan@users.noreply.github.com> Date: Sun, 30 Apr 2023 13:24:58 +0800 Subject: [PATCH] Update markdown.tsx --- app/components/markdown.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 3d8645659..e15c498e6 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -96,7 +96,8 @@ export function Markdown( components={{ pre: PreCode, a: (aProps) => { - const isInternal = /^\/#/i.test(aProps.href); + const href = aProps.href || ""; + const isInternal = /^\/#/i.test(href); const target = isInternal ? "_self" : aProps.target ?? "_blank"; return ; },