--- a/hugo/themes/learn/static/js/learn.js Tue Aug 20 03:24:59 2019 -0400
+++ b/hugo/themes/learn/static/js/learn.js Thu Aug 22 04:05:48 2019 +0000
@@ -195,9 +195,10 @@
const isInHeading = code.parent().is('h1,h2,h3,h4,h5,h6,h7');
+ const isInToc = code.parents('nav#TableOfContents').length > 0; const isTooShort = code.text().length < 5
- if (!isInHeading && !isTooShort) {
+ if (!isInHeading && !isInToc && !isTooShort) { code.after('<span class="copy-to-clipboard" title="Copy to clipboard" />');
code.next('.copy-to-clipboard').on('mouseleave', removeTooltip);