From 937a7adbee82ee4ee952c2c7acc92d9286a82725 Mon Sep 17 00:00:00 2001 From: Damian Stasik <920747+damianstasik@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:30:11 +0200 Subject: [PATCH] Open markdown links in the same tab Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> --- frontend/src/components/Markdown/A.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/Markdown/A.tsx b/frontend/src/components/Markdown/A.tsx index c43d8552..644933be 100644 --- a/frontend/src/components/Markdown/A.tsx +++ b/frontend/src/components/Markdown/A.tsx @@ -1,14 +1,19 @@ -import { HTMLAttributes } from "react"; +import { AnchorHTMLAttributes } from "react"; + +function isExternalLink(href: string) { + return href.startsWith("http"); +} export function MarkdownA({ children, + href, ...rest -}: HTMLAttributes) { +}: AnchorHTMLAttributes) { return ( {children}