We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6bc46db commit f4d5417Copy full SHA for f4d5417
src/client/app/composables/copyCode.ts
@@ -14,10 +14,15 @@ export function useCopyCode() {
14
}
15
16
const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(
17
- parent.classList.toString()
+ parent.className
18
)
19
20
- let { innerText: text = '' } = sibling
+ let text = ''
21
+
22
+ sibling
23
+ .querySelectorAll('span.line:not(.diff.remove)')
24
+ .forEach((node) => (text += (node.textContent || '') + '\n'))
25
+ text = text.slice(0, -1)
26
27
if (isShell) {
28
text = text.replace(/^ *(\$|>) /gm, '').trim()
0 commit comments