mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-08 04:51:23 -06:00
Fix copy code button interaction with kramdown line numbers (#1143)
Co-authored-by: Simone <26844016+simonebortolin@users.noreply.github.com>
This commit is contained in:
parent
4a7fbbca92
commit
8894630659
@ -504,7 +504,7 @@ jtd.onReady(function(){
|
||||
|
||||
copyButton.addEventListener('click', function () {
|
||||
if(timeout === null) {
|
||||
var code = codeBlock.querySelector('pre:not(.lineno)').innerText;
|
||||
var code = (codeBlock.querySelector('pre:not(.lineno, .highlight)') || codeBlock.querySelector('code')).innerText;
|
||||
window.navigator.clipboard.writeText(code);
|
||||
|
||||
copyButton.innerHTML = svgCopied;
|
||||
|
Loading…
x
Reference in New Issue
Block a user