neo4j-documentation / docs-ui

Mozilla Public License 2.0
4 stars 23 forks source link

use innerText of code block for copy #93

Closed recrwplay closed 2 years ago

recrwplay commented 2 years ago

On pages like Operations manual -> Clustering, Copy to clipboard resulted in broken code because of character escaping (eg < to &lt;) and the callouts were included.

Using element.innerText looks safe and reliable, keeps characters unescaped, and excludes callouts from the copied content.

netlify[bot] commented 2 years ago

✔️ Deploy Preview for neo4j-docs-ui ready!

🔨 Explore the source changes: b3d6e7df003dab15717e8db8ed26d43bf1e78edb

🔍 Inspect the deploy log: https://app.netlify.com/sites/neo4j-docs-ui/deploys/62210986805d850008d77387

😎 Browse the preview: https://deploy-preview-93--neo4j-docs-ui.netlify.app/