diff --git a/edit.js b/edit.js index 14557a53..dbaca5ba 100644 --- a/edit.js +++ b/edit.js @@ -1497,15 +1497,20 @@ function fromMozillaFormat() { } } function doAddSection(section) { + section.code = section.code.trim(); + // don't add empty sections + if (!section.code + && !section.urls + && !section.urlPrefixes + && !section.domains + && !section.regexps) { + return; + } if (!firstAddedCM) { if (!initFirstSection(section)) { return; } } - // don't add empty sections - if (!(section.code || section.urls || section.urlPrefixes || section.domains || section.regexps)) { - return; - } setCleanItem(addSection(null, section), false); firstAddedCM = firstAddedCM || editors.last; }