Skip to content

Commit 6c66af4

Browse files
fix(web): copying a long diagram no longer stalls on trailing-newline trim
AI-assisted; verified with the tests and tools listed above.
1 parent d36ddb1 commit 6c66af4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎apps/web/src/markdown-clipboard.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function serializeNode(node: Node, inTableCell = false): string {
224224
if (markdownCopy !== null) {
225225
// A diagram copies as its fenced source, which is code too.
226226
if (element.hasAttribute("data-markdown-mermaid")) {
227-
return verbatimBlock(escapeTablePipes(markdownCopy.replace(/\n+$/, ""), inTableCell));
227+
return verbatimBlock(escapeTablePipes(markdownCopy.trimEnd(), inTableCell));
228228
}
229229
return element.hasAttribute("data-markdown-math")
230230
? markdownCopy

0 commit comments

Comments
 (0)