From f91c84687440d9292ba2c6d316a344961d40e4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Thu, 28 Dec 2017 16:45:29 +0100 Subject: [PATCH] Fix clipboard functionality Everything should work as advertised now --- docs/index.html | 2 +- static-parts/index-start.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 1c26fcd01..f49e7dd18 100644 --- a/docs/index.html +++ b/docs/index.html @@ -46,7 +46,7 @@ button.addEventListener ("click", function() { //The following regex removes all the comments from the snippet - const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); + const text = element.textContent; // Apparently you can't copy a variable to clipboard so you need to create text input element, // give it a value, copy it and then remove it from DOM. const textArea = document.createElement("textarea"); diff --git a/static-parts/index-start.html b/static-parts/index-start.html index 94678ecaa..2dd7839c9 100644 --- a/static-parts/index-start.html +++ b/static-parts/index-start.html @@ -46,7 +46,7 @@ button.addEventListener ("click", function() { //The following regex removes all the comments from the snippet - const text = element.textContent.replace(/\/\*(.|[\r\n])*?\*\//g, '').replace(/\/\/.*/gm, ''); + const text = element.textContent; // Apparently you can't copy a variable to clipboard so you need to create text input element, // give it a value, copy it and then remove it from DOM. const textArea = document.createElement("textarea");