Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 3, 2023
2 parents f54fb17 + 435e82c commit 14b3f30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a {...aProps} target={target} />;
},
}}
linkTarget={"_blank"}
>
{props.content}
</ReactMarkdown>
Expand Down

0 comments on commit 14b3f30

Please sign in to comment.