From 0ca4cf01c712c3d557395ab2cc14b1ef6370da21 Mon Sep 17 00:00:00 2001 From: marcelle <1852848+laanak08@users.noreply.github.com> Date: Fri, 31 Jan 2025 21:02:38 -0500 Subject: [PATCH] really really open markdown links outside (#1002) --- ui/desktop/src/components/MarkdownContent.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/desktop/src/components/MarkdownContent.tsx b/ui/desktop/src/components/MarkdownContent.tsx index 9dcdb58b..a490587f 100644 --- a/ui/desktop/src/components/MarkdownContent.tsx +++ b/ui/desktop/src/components/MarkdownContent.tsx @@ -6,6 +6,10 @@ import { oneLight } from 'react-syntax-highlighter/dist/cjs/styles/prism'; import { Check, Copy } from './icons'; import { visit } from 'unist-util-visit'; +const UrlTransform = { + a: ({ node, ...props }) => , +}; + function rehypeinlineCodeProperty() { return function (tree) { if (!tree) return; @@ -84,6 +88,7 @@ export default function MarkdownContent({ content, className = '' }: MarkdownCon prose-code:break-all prose-code:whitespace-pre-wrap ${className}`} components={{ + ...UrlTransform, code({ node, className, children, inlinecode, ...props }) { const match = /language-(\w+)/.exec(className || 'language-text'); return inlinecode == 'false' && match ? (