diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index b5805e50..49bb581d 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -46,8 +46,13 @@ function _MarkDownContent(props: { content: string }) { ]} components={{ pre: PreCode, + a: (aProps) => { + const href = aProps.href || ""; + const isInternal = /^\/#/i.test(href); + const target = isInternal ? "_self" : aProps.target ?? "_blank"; + return ; + }, }} - linkTarget={"_blank"} > {props.content}