We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf5c0be commit 53a5f13Copy full SHA for 53a5f13
1 file changed
lib/handlebars/runtime.js
@@ -93,15 +93,8 @@ export function template(templateSpec, env) {
93
}
94
if (result != null) {
95
if (options.indent) {
96
- let lines = result.split('\n');
97
- for (let i = 0, l = lines.length; i < l; i++) {
98
- if (!lines[i] && i + 1 === l) {
99
- break;
100
- }
101
-
102
- lines[i] = options.indent + lines[i];
103
104
- result = lines.join('\n');
+ result =
+ options.indent + result.replace(/\n(?!$)/g, '\n' + options.indent);
105
106
return result;
107
} else {
0 commit comments