Revert "Improve partial indenting performance"
This reverts commit 08fddee033.
The change caused performance regressions in some cases and performance
was not consistent across engines.
This commit is contained in:
committed by
Jay Linski
parent
8841a5f6d3
commit
45443b4290
@@ -89,8 +89,15 @@ export function template(templateSpec, env) {
|
||||
}
|
||||
if (result != null) {
|
||||
if (options.indent) {
|
||||
result =
|
||||
options.indent + result.replace(/\n(?!$)/g, '\n' + options.indent);
|
||||
let lines = result.split('\n');
|
||||
for (let i = 0, l = lines.length; i < l; i++) {
|
||||
if (!lines[i] && i + 1 === l) {
|
||||
break;
|
||||
}
|
||||
|
||||
lines[i] = options.indent + lines[i];
|
||||
}
|
||||
result = lines.join('\n');
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user