Bug 1323713 - fix prettify CSS error when encountering extra closing brace;r=tromey
MozReview-Commit-ID: 5TAxEP5561K
This commit is contained in:
@@ -284,7 +284,11 @@ function prettifyCSS(text, ruleCount) {
|
||||
}
|
||||
|
||||
if (isCloseBrace) {
|
||||
indent = TAB_CHARS.repeat(--indentLevel);
|
||||
// Even if the stylesheet contains extra closing braces, the indent level should
|
||||
// remain > 0.
|
||||
indentLevel = Math.max(0, indentLevel - 1);
|
||||
|
||||
indent = TAB_CHARS.repeat(indentLevel);
|
||||
result = result + indent + "}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user