summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/util.js b/lib/util.js
index 3335faf3d8..9a68ea0068 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -575,13 +575,9 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
}
if (str.indexOf('\n') > -1) {
if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
+ str = str.replace(/\n/g, '\n ');
} else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
+ str = str.replace(/(^|\n)/g, '\n ');
}
}
} else {