From 50abefe340c398dc561ce94e0853c1cabe313e74 Mon Sep 17 00:00:00 2001 From: DanSylvest Date: Fri, 11 Sep 2026 14:28:16 +0300 Subject: [PATCH] fix(map): Fixed links in Description - now it opens sites in new tab --- .../components/ui-kit/MarkdownTextViewer.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/js/hooks/Mapper/components/ui-kit/MarkdownTextViewer.tsx b/assets/js/hooks/Mapper/components/ui-kit/MarkdownTextViewer.tsx index 679cae2c..585bda9b 100644 --- a/assets/js/hooks/Mapper/components/ui-kit/MarkdownTextViewer.tsx +++ b/assets/js/hooks/Mapper/components/ui-kit/MarkdownTextViewer.tsx @@ -1,4 +1,4 @@ -import Markdown from 'react-markdown'; +import Markdown, { type Components } from 'react-markdown'; import remarkGfm from 'remark-gfm'; import remarkBreaks from 'remark-breaks'; @@ -6,12 +6,24 @@ import classes from './MarkdownTextViewer.module.scss'; const REMARK_PLUGINS = [remarkGfm, remarkBreaks]; -type MarkdownTextViewerProps = { children: string }; +const MARKDOWN_COMPONENTS: Components = { + a: ({ node, ...props }) => { + void node; + + return ; + }, +}; + +export interface MarkdownTextViewerProps { + children: string; +} export const MarkdownTextViewer = ({ children }: MarkdownTextViewerProps) => { return (
- {children} + + {children} +
); };