diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/footer.html | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 1badd4a..2c6511b 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -120,7 +120,17 @@ selection.removeRange(range); }); - container.appendChild(copybutton); + if (container.classList.contains("highlight")) { + container.appendChild(copybutton); + } else if (container.parentNode.firstChild == container) { + // td containing LineNos + } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") { + // table containing LineNos and code + codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton); + } else { + // code blocks not having highlight as parent class + codeblock.parentNode.appendChild(copybutton); + } }); </script> {{- end }} |
