From 725b71d323d17a4bb664e98ecf2fae451740119d Mon Sep 17 00:00:00 2001 From: yun-zhi-ztl Date: Sat, 14 Mar 2026 19:27:50 +0800 Subject: [PATCH] fix(skill): contain readme content overflow --- web/src/features/skill/markdown-renderer.tsx | 39 +++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/web/src/features/skill/markdown-renderer.tsx b/web/src/features/skill/markdown-renderer.tsx index 6b164983..5e01e119 100644 --- a/web/src/features/skill/markdown-renderer.tsx +++ b/web/src/features/skill/markdown-renderer.tsx @@ -9,13 +9,48 @@ interface MarkdownRendererProps { } export function MarkdownRenderer({ content, className }: MarkdownRendererProps) { - const containerClassName = [className, 'prose prose-sm max-w-none dark:prose-invert'] + const containerClassName = [ + className, + 'prose prose-sm max-w-none break-words [overflow-wrap:anywhere] dark:prose-invert', + ] .filter(Boolean) .join(' ') return (
- + ( +
+
{children}
+
+ ), + code: ({ className: codeClassName, children, ...props }) => { + const isInline = !codeClassName?.includes('language-') + + if (isInline) { + return ( + + {children} + + ) + } + + return ( + + {children} + + ) + }, + table: ({ children }) => ( +
+ {children}
+
+ ), + }} + > {content}