Copy both error message and content on mermaid error (#3120)

This commit is contained in:
Matt Rubens 2025-05-02 10:09:49 -04:00 committed by GitHub
parent 2e66081921
commit 71f428bbeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,7 +186,8 @@ export default function MermaidBlock({ code }: MermaidBlockProps) {
<CopyButton
onClick={(e) => {
e.stopPropagation()
copyWithFeedback(code, e)
const combinedContent = `Error: ${error}\n\n\`\`\`mermaid\n${code}\n\`\`\``
copyWithFeedback(combinedContent, e)
}}>
<span className={`codicon codicon-${showCopyFeedback ? "check" : "copy"}`}></span>
</CopyButton>