Commit 694ad269 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Allow for retention of line breaks in copy-to-clipboard

By changing the temporary element for holding text from a `span` to a
`pre`, line breaks in formatted strings may be retained when copying
to the clipboard

NB: This change cannot be directly tested
parent 26f25696
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* to copy text. * to copy text.
*/ */
function copyText(text) { function copyText(text) {
const temp = document.createElement('span'); const temp = document.createElement('pre');
temp.className = 'copy-text'; temp.className = 'copy-text';
temp.textContent = text; temp.textContent = text;
document.body.appendChild(temp); document.body.appendChild(temp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment