Skip to content
Snippets Groups Projects
Unverified Commit 88946306 authored by Matt Wang's avatar Matt Wang Committed by GitHub
Browse files

Fix copy code button interaction with kramdown line numbers (#1143)

parent 4a7fbbca
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment