moz-import: trim empty lines at section start/end
This commit is contained in:
parent
0ceff44000
commit
2875bb77d0
13
edit.js
13
edit.js
|
@ -1497,15 +1497,20 @@ function fromMozillaFormat() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function doAddSection(section) {
|
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 (!firstAddedCM) {
|
||||||
if (!initFirstSection(section)) {
|
if (!initFirstSection(section)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// don't add empty sections
|
|
||||||
if (!(section.code || section.urls || section.urlPrefixes || section.domains || section.regexps)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setCleanItem(addSection(null, section), false);
|
setCleanItem(addSection(null, section), false);
|
||||||
firstAddedCM = firstAddedCM || editors.last;
|
firstAddedCM = firstAddedCM || editors.last;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user