From f697c72d5c17e071e9feb17044c27caaf0543110 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Tue, 8 Jan 2019 16:17:40 +0100 Subject: updated editor tool --- tools/editor/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/editor/index.html b/tools/editor/index.html index 3e91b4b..f9123d4 100644 --- a/tools/editor/index.html +++ b/tools/editor/index.html @@ -46,16 +46,18 @@ editor.addEventListener('paste', function (evt) { evt.preventDefault(); - document.execCommand('insertHTML', false, evt.clipboardData.getData('text/plain')); + + let clipped = evt.clipboardData.getData('text/plain'); + clipped = clipped.replace(/(\r\n|\n|\r)/gm, "
"); + document.execCommand('insertHTML', false, clipped); }); if (typeof (Storage) !== 'undefined') { - editor.innerHTML = sessionStorage.getItem('content'); + editor.innerHTML = localStorage.getItem('content'); setInterval(function () { - sessionStorage.setItem('content', editor.innerHTML); + localStorage.setItem('content', editor.innerHTML); }, autoSaveFrequency); - } else { console.log('Local Storage not supported'); } -- cgit v1.2.3