From 77473d79f5b0d9362fb3b7fb00a5725ad000de12 Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Sat, 12 Dec 2009 00:08:47 +0000 Subject: Futon: Improve display of multi-line strings in tabular document view. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889867 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/futon.format.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'share/www/script/futon.format.js') diff --git a/share/www/script/futon.format.js b/share/www/script/futon.format.js index 601a91d3..5feee817 100644 --- a/share/www/script/futon.format.js +++ b/share/www/script/futon.format.js @@ -42,7 +42,7 @@ case "string": var retval = val; if (type == "string" && !options.escapeStrings) { - retval = indentLines(retval, tab); + retval = indentLines(retval.replace(/\r\n/g, "\n"), tab.substr(options.indent)); } else { retval = escape(JSON.stringify(val)); } @@ -70,7 +70,9 @@ buf.push(index > 0 ? itemsep : options.linesep); buf.push(tab, format(val[index], depth + 1)); } - if (index >= 0) buf.push(options.linesep, tab.substr(options.indent)); + if (index >= 0) { + buf.push(options.linesep, tab.substr(options.indent)); + } buf.push("]"); if (options.html) { return "" + buf.join("") + ""; @@ -95,7 +97,9 @@ ": ", format(val[key], depth + 1)); index++; } - if (index >= 0) buf.push(options.linesep, tab.substr(options.indent)); + if (index >= 0) { + buf.push(options.linesep, tab.substr(options.indent)); + } buf.push("}"); if (options.html) { return "" + buf.join("") + ""; -- cgit v1.2.3