diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-03-05 14:25:06 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-03-05 14:25:06 -0800 |
commit | 73d6511550ec7ac895818b74360e87f799fd9171 (patch) | |
tree | f3ea31052a7deca951e6dc42b2881aca1ab2627c /src/shell.html | |
parent | 1af7db58eefaa110f2748b7c4dd52f8d022f9aa6 (diff) |
properly handle html-unfriendly print() output
Diffstat (limited to 'src/shell.html')
-rw-r--r-- | src/shell.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shell.html b/src/shell.html index 69217b18..a41086b9 100644 --- a/src/shell.html +++ b/src/shell.html @@ -19,7 +19,10 @@ print: (function() { var element = document.getElementById('output'); return function(text) { - element.innerHTML += text.replace('\n', '<br>', 'g') + '<br>'; + text = text.replace(/</g, "<"); + text = text.replace(/>/g, ">"); + text = text.replace('\n', '<br>', 'g'); + element.innerHTML += text + '<br>'; }; })(), canvas: document.getElementById('canvas') |