Skip to content

Commit

Permalink
fix: fallback to textContent while copying code
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Dec 19, 2023
1 parent 7147b7a commit bdfc01c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/app/composables/copyCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export function useCopyCode() {
sibling
.querySelectorAll('span.line:not(.diff.remove)')
.forEach((node) => (text += (node.textContent || '') + '\n'))
text = text.slice(0, -1)

text = (text || sibling.textContent || '').slice(0, -1)

if (isShell) {
text = text.replace(/^ *(\$|>) /gm, '').trim()
Expand Down

0 comments on commit bdfc01c

Please sign in to comment.