copy button on every code block
the bubble's copy button copies the whole reply, which is the wrong unit when the reply is prose ending in one command to run. fenced blocks get their own button; inline code doesn't. text read from textContent at click time rather than the markdown ast, trailing newline stripped so a pasted command doesn't run itself. the positioned wrapper takes the vertical margin, or the pre's own margin collapses through it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,16 @@
|
||||
font-family: ui-monospace, monospace;
|
||||
}
|
||||
|
||||
/* A fenced block is wrapped so its copy button has something to position against. The wrapper carries
|
||||
the spacing, or the pre's own margin would collapse through it and defeat the first/last-child reset. */
|
||||
.chat-md .chat-code {
|
||||
margin: 0.75em 0;
|
||||
}
|
||||
|
||||
.chat-md .chat-code pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.chat-md pre {
|
||||
margin: 0.75em 0;
|
||||
padding: 0.75em 1em;
|
||||
|
||||
Reference in New Issue
Block a user