fixup d97337de: preceding comment may be absent
This commit is contained in:
parent
e50de59669
commit
dd05955a38
|
@ -23,10 +23,11 @@ var mozParser = (() => {
|
||||||
const section = {code: '', start: {line, col}};
|
const section = {code: '', start: {line, col}};
|
||||||
// move last comment before @-moz-document inside the section
|
// move last comment before @-moz-document inside the section
|
||||||
if (!/\/\*[\s\n]*AGENT_SHEET[\s\n]*\*\//.test(lastCmt)) {
|
if (!/\/\*[\s\n]*AGENT_SHEET[\s\n]*\*\//.test(lastCmt)) {
|
||||||
section.code = lastCmt + '\n';
|
if (lastCmt) {
|
||||||
const indent = outerText.match(/^\s*/)[0];
|
section.code = lastCmt + '\n';
|
||||||
outerText = outerText.slice(0, -lastCmt.length);
|
outerText = outerText.slice(0, -lastCmt.length);
|
||||||
outerText = indent + outerText.trim();
|
}
|
||||||
|
outerText = outerText.match(/^\s*/)[0] + outerText.trim();
|
||||||
}
|
}
|
||||||
if (outerText.trim()) {
|
if (outerText.trim()) {
|
||||||
lastSection.code = outerText;
|
lastSection.code = outerText;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user