Skip to content

Commit bdfc01c

Browse files
committed
fix: fallback to textContent while copying code
1 parent 7147b7a commit bdfc01c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client/app/composables/copyCode.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export function useCopyCode() {
2121
sibling
2222
.querySelectorAll('span.line:not(.diff.remove)')
2323
.forEach((node) => (text += (node.textContent || '') + '\n'))
24-
text = text.slice(0, -1)
24+
25+
text = (text || sibling.textContent || '').slice(0, -1)
2526

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

0 commit comments

Comments
 (0)