🐛 fix: avoid copying code block line numbers (#647)
Some checks failed
Build Site / Check and Build for Pull Requests (push) Has been cancelled
Build Site / Build and Deploy on Main Push (push) Has been cancelled

Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
aslowwriter 2026-05-01 09:31:47 +02:00 committed by GitHub
parent 17029f02b1
commit 35098abea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -27,7 +27,13 @@ const copyCodeAndChangeIcon = async (copyDiv, block) => {
};
const getNonTableCode = (block) => {
return [...block.querySelectorAll('code')].map((code) => code.textContent).join('');
return [...block.querySelectorAll('code')]
.map((code) => {
const clone = code.cloneNode(true);
clone.querySelectorAll('.giallo-ln').forEach(el => el.remove());
return clone.textContent;
})
.join('');
};
const getTableCode = (block) => {