Skip to content

Commit 6d32620

Browse files
committed
revert fix and remove line numbering for code blocks
1 parent ddf75db commit 6d32620

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

ui/src/js/04-copy-to-clipboard.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,7 @@
5353
}
5454

5555
function writeToClipboard (code) {
56-
var text
57-
// Check if this is a line-numbered code block (table structure)
58-
var table = code.querySelector('table.hljs-ln')
59-
if (table) {
60-
// Extract text only from code cells (not line number cells)
61-
var codeCells = table.querySelectorAll('td.hljs-ln-code')
62-
text = Array.prototype.slice.call(codeCells).map(function (cell) {
63-
return cell.textContent
64-
}).join('\n')
65-
} else {
66-
// Fallback to original method for non-line-numbered blocks
67-
text = code.innerText
68-
}
69-
text = text.replace(TRAILING_SPACE_RX, '')
56+
var text = code.innerText.replace(TRAILING_SPACE_RX, '')
7057
if (code.dataset.lang === 'console' && text.startsWith('$ ')) text = extractCommands(text)
7158
window.navigator.clipboard.writeText(text).then(
7259
function () {

ui/src/js/vendor/highlight.bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,5 +336,5 @@
336336
})
337337

338338
// Then, apply line numbers to highlighted blocks
339-
hljs.initLineNumbersOnLoad()
339+
// hljs.initLineNumbersOnLoad() // Disabled to fix copy/paste issues
340340
})()

0 commit comments

Comments
 (0)