fix: remove shell code copy trailing newline (#1561)

pull/1568/head
Q.Ben Zheng 2 years ago committed by GitHub
parent 4b0b1ef35f
commit f36cd0d626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,7 @@ export function useCopyCode() {
let { innerText: text = '' } = sibling let { innerText: text = '' } = sibling
if (isShell) { if (isShell) {
text = text.replace(/^ *(\$|>) /gm, '') text = text.replace(/^ *(\$|>) /gm, '').trim()
} }
copyToClipboard(text).then(() => { copyToClipboard(text).then(() => {

Loading…
Cancel
Save