Skip to content

Commit

Permalink
fix: add MarkdownLink to CustomMarkdownComponents (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivyjeong13 authored Jan 24, 2025
1 parent 5955b7e commit 5fe7c57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ui/admin/app/components/react-markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ const MarkdownOrderedList = memo(

MarkdownOrderedList.displayName = "MarkdownOrderedList";

const MarkdownLink = memo(
({ node: _node, ...props }: MarkdownComponentProps<"a">) => (
<a {...props} target="_blank" rel="noopener noreferrer">
{props.children}
</a>
)
);

MarkdownLink.displayName = "MarkdownLink";

export const CustomMarkdownComponents: Partial<Components> = {
ol: MarkdownOrderedList as Components["ol"],
a: MarkdownLink as Components["a"],
};

0 comments on commit 5fe7c57

Please sign in to comment.