From 9b5aef7fc5d5fc5720c57a9e3bfb293cb3de4ec9 Mon Sep 17 00:00:00 2001
From: Bamidev
')
+ .replaceAll("\n", '
')
+}
+
function onOutputReceived( output ) {
let span = document.createElement("span")
- span.innerText = output
+ span.innerHTML = escapeText(output)
- document.body.appendChild( span )
+ document.body.firstElementChild.appendChild( span )
}
function onErrorOutputReceived( output ) {
let span = document.createElement("span")
span.setAttribute("class", "stderr")
- span.innerText = output
+ span.innerHTML = escapeText(output)
- document.body.appendChild( span )
+ document.body.firstElementChild.appendChild( span )
}
function print( text ) {
- $('body').append( text )
+ $('body div').append( text )
}
function printPrefix() {
- print( working_dir + '$ ' )
+ print(working_dir + '$ ')
}
diff --git a/examples/resources/style.css b/examples/resources/style.css
index ddd6a83..97e81f5 100644
--- a/examples/resources/style.css
+++ b/examples/resources/style.css
@@ -1,7 +1,8 @@
body {
background-color: #000;
color: #0F0;
- font: 1em coolFont;
+ font: 1.2em coolFont;
+ margin-top: 0;
word-break: break-all;
word-wrap: break-word;
white-space: pre-line;
diff --git a/examples/resources/terminal.html b/examples/resources/terminal.html
index df823f2..e130b10 100644
--- a/examples/resources/terminal.html
+++ b/examples/resources/terminal.html
@@ -11,5 +11,7 @@
-