From bfb35e77b8f96791fd71a5d10fe1e35db236f191 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 6 Aug 2018 20:56:33 +0300 Subject: [PATCH] strip more trailing spaces in a custom usercss template --- edit/source-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit/source-editor.js b/edit/source-editor.js index 27ecde42..70247027 100644 --- a/edit/source-editor.js +++ b/edit/source-editor.js @@ -128,7 +128,7 @@ function createSourceEditor(style) { style.name || t('usercssReplaceTemplateName') + ' - ' + new Date().toLocaleString()}`); // strip the last dummy section if any, add an empty line followed by the section - style.sourceCode = code.replace(/@-moz-document[^{]*\{[^}]*\}\s*$|\s+$/g, '') + '\n\n' + section; + style.sourceCode = code.replace(/\s*@-moz-document[^{]*\{[^}]*\}\s*$|\s+$/g, '') + '\n\n' + section; cm.startOperation(); cm.setValue(style.sourceCode); cm.clearHistory();