strip more trailing spaces in a custom usercss template
This commit is contained in:
parent
baf037e0c4
commit
bfb35e77b8
|
@ -128,7 +128,7 @@ function createSourceEditor(style) {
|
||||||
style.name ||
|
style.name ||
|
||||||
t('usercssReplaceTemplateName') + ' - ' + new Date().toLocaleString()}`);
|
t('usercssReplaceTemplateName') + ' - ' + new Date().toLocaleString()}`);
|
||||||
// strip the last dummy section if any, add an empty line followed by the section
|
// 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.startOperation();
|
||||||
cm.setValue(style.sourceCode);
|
cm.setValue(style.sourceCode);
|
||||||
cm.clearHistory();
|
cm.clearHistory();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user