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:
Mohamed Akram
2024-09-06 19:31:04 +04:00
committed by Jay Linski
parent 8841a5f6d3
commit 45443b4290
+9 -2
View File
@@ -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 {