Skip to content

Commit

Permalink
Better show multiline strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bkuker committed May 21, 2015
1 parent e8753f7 commit 8907b8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions WebContent/jsonview.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ body {
color: green;
}

.type-string-multiline {
color: green;
font-size: smaller;
white-space: pre;
padding-left: 25px;
border-left: 1px dashed #ddd;
}

.type-date {
color: gray;
}
Expand Down
2 changes: 2 additions & 0 deletions WebContent/workerFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function valueToHTML(value) {
else if (valueType == "string")
if (/^(http|https):\/\/[^\s]+$/.test(value))
output += decorateWithSpan('"', "type-string") + '<a href="' + value + '">' + htmlEncode(value) + '</a>' + decorateWithSpan('"', "type-string");
else if ((value.match(/\n/g) || []).length > 2)
output += '<div class="type-string-multiline">' + htmlEncode(value) + '</div>';
else
output += decorateWithSpan('"' + value + '"', "type-string");
else if (valueType == "boolean")
Expand Down

0 comments on commit 8907b8c

Please sign in to comment.