diff options
author | Kris Maglione <maglione.k@gmail.com> | 2012-11-27 22:57:45 -0800 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2012-11-27 22:57:45 -0800 |
commit | a0f066816677dcf6e93761540bcd075e1d33ae5e (patch) | |
tree | dea79ac0c8996229f51f73cf5081b9c58d83fc61 /common/content/mow.js | |
parent | 6200b08c13b0d813fe4e18706b8d57defa184380 (diff) | |
download | pentadactyl-a0f066816677dcf6e93761540bcd075e1d33ae5e.tar.gz |
Death to E4X and stuff.
Diffstat (limited to 'common/content/mow.js')
-rw-r--r-- | common/content/mow.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/content/mow.js b/common/content/mow.js index 36d271c9..0aade542 100644 --- a/common/content/mow.js +++ b/common/content/mow.js @@ -112,7 +112,7 @@ var MOW = Module("mow", { highlightGroup = "CommandOutput " + (highlightGroup || ""); - if (isObject(data) && !isinstance(data, _)) { + if (isObject(data) && !isinstance(data, _) && !DOM.isJSONXML(data)) { this.lastOutput = null; var output = DOM(["div", { style: "white-space: nowrap", highlight: highlightGroup }], @@ -127,9 +127,16 @@ var MOW = Module("mow", { } this.messages.push(data); } + else if (DOM.isJSONXML(data) || isString(data)) { + let style = isString(data) ? "pre-wrap" : "nowrap"; + this.lastOutput = ["div", { style: "white-space: " + style, highlight: highlightGroup }, + data]; + + var output = DOM(this.lastOutput, this.document); + } else { let style = isString(data) ? "pre-wrap" : "nowrap"; - this.lastOutput = <div style={"white-space: " + style} highlight={highlightGroup}>{data}</div>; + this.lastOutput = <div style="white-space: nowrap" highlight={highlightGroup}>{data}</div>; var output = DOM(this.lastOutput, this.document); } |