Skip to content

Commit 71f428b

Browse files
authored
Copy both error message and content on mermaid error (#3120)
1 parent 2e66081 commit 71f428b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webview-ui/src/components/common/MermaidBlock.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ export default function MermaidBlock({ code }: MermaidBlockProps) {
186186
<CopyButton
187187
onClick={(e) => {
188188
e.stopPropagation()
189-
copyWithFeedback(code, e)
189+
const combinedContent = `Error: ${error}\n\n\`\`\`mermaid\n${code}\n\`\`\``
190+
copyWithFeedback(combinedContent, e)
190191
}}>
191192
<span className={`codicon codicon-${showCopyFeedback ? "check" : "copy"}`}></span>
192193
</CopyButton>

0 commit comments

Comments
 (0)