diff options
| author | ianb <devnull@localhost> | 2005-05-07 03:07:55 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-07 03:07:55 +0000 |
| commit | d3245b6b9b3050b29233fbf31ec134cbb6c65940 (patch) | |
| tree | 2743533957c0ffdf1153875381123b2f5c2ecce3 /examples/console | |
| parent | e648a9ebbb2bae9112d13986cc7d827062fcb39c (diff) | |
| download | paste-d3245b6b9b3050b29233fbf31ec134cbb6c65940.tar.gz | |
Use <pre> for output
Diffstat (limited to 'examples/console')
| -rw-r--r-- | examples/console/web/static/command.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/console/web/static/command.js b/examples/console/web/static/command.js index 5b592fd..37c7075 100644 --- a/examples/console/web/static/command.js +++ b/examples/console/web/static/command.js @@ -14,12 +14,16 @@ function send_command() { command_long.value = ''; var result = servlet.run(command); var output_div = document.getElementById('output'); - output_html += '<br>\n' + '<span class="input">' - + command + '</span>'; - if (result != nil) { - output_html += '<br>\n' + '<span class="output">' - + result + '</span>'; + output_html += '<span class="input">>>> ' + + html_quote(command) + '</span>\n'; + if (result != null) { + output_html += '<span class="output">' + + html_quote(result) + '<span>\n'; } output_div.innerHTML = output_html; return false; } + +function html_quote(s) { + return s.replace('&', '&').replace('<', '<'); +} |
