diff --git a/README.md b/README.md index f0160c9..807be6e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Demo @ https://cydave.github.io/zola-theme-papermod/ + [ ] Regular Mode + [ ] Home-Info Mode + [ ] Profile Mode -+ [ ] Code copy buttons ++ [x] Code copy buttons + [ ] Search page + [ ] SEO Metadata + [ ] Language switcher (multi-language support) diff --git a/templates/partials/footer.html b/templates/partials/footer.html index 405f394..4b445e7 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -98,7 +98,12 @@ copybutton.addEventListener('click', (cb) => { if ('clipboard' in navigator) { - navigator.clipboard.writeText(codeblock.textContent); + var content = codeblock.textContent; + if(codeblock.firstChild.tagName == 'TABLE') { + content = Array(...codeblock.firstChild.getElementsByTagName('span')).map((span) => { return span.textContent; }).join(''); + } + console.log(content); + navigator.clipboard.writeText(content); copyingDone(); return; }