We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd0cf8d commit dd04617Copy full SHA for dd04617
assets/js/code-copy.js
@@ -6,7 +6,8 @@ function CopyCode(clipboard) {
6
button.innerHTML = '<i class="fas fa-copy"></i> Copy';
7
8
button.addEventListener('click', function() {
9
- clipboard.writeText(codeBlock.textContent).then(
+ // removes return carriage from copied text
10
+ clipboard.writeText(codeBlock.textContent.replace(/\n$/g, "")).then(
11
function() {
12
button.blur(); /* Chrome fix */
13
button.innerHTML = '<i class="fas fa-check"></i> Copied!';
0 commit comments