diff --git a/assets/js/code-copy.js b/assets/js/code-copy.js index 68036c8..5c7db78 100644 --- a/assets/js/code-copy.js +++ b/assets/js/code-copy.js @@ -36,7 +36,11 @@ var codeEl = containerEl.firstElementChild; copyBtn.addEventListener('click', function() { try { - var selection = selectText(codeEl); + if(codeEl.firstElementChild instanceof HTMLTableElement) { + var selection = selectText(codeEl.firstElementChild.firstElementChild.firstElementChild.lastElementChild); + } else { + var selection = selectText(codeEl); + } document.execCommand('copy'); selection.removeAllRanges();