diff --git a/examples/northern-lights.txt b/examples/northern-lights.txt index f31a429..8f97b6e 100644 --- a/examples/northern-lights.txt +++ b/examples/northern-lights.txt @@ -19,4 +19,4 @@ __ + * `' `'|. `: "' `---"""----....____,..^---`^``----.,.___ `. `. . ____,.,- ___,--'""`---"' ^ ^ ^ ^ """'---,..___ __,..---""' ---"' ^ ``--..,__ D. Rice \ No newline at end of file +--"' ^ ``--..,__ D. Rice diff --git a/examples/preview-art.sh b/examples/preview-art.sh old mode 100644 new mode 100755 diff --git a/examples/resources/ShareTechMono-Regular.ttf b/examples/resources/ShareTechMono-Regular.ttf deleted file mode 100644 index 29c2b8b..0000000 Binary files a/examples/resources/ShareTechMono-Regular.ttf and /dev/null differ diff --git a/examples/resources/main.js b/examples/resources/main.js index e4f5208..b4df455 100644 --- a/examples/resources/main.js +++ b/examples/resources/main.js @@ -39,28 +39,35 @@ function onExecutionEnded() { is_executing = false } +function escapeText(text) { + return text + .replaceAll(' ', ' ') + .replaceAll("\r\n", '
') + .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..110e8e3 100644 --- a/examples/resources/style.css +++ b/examples/resources/style.css @@ -1,17 +1,13 @@ body { background-color: #000; color: #0F0; - font: 1em coolFont; + font: 1.2em monospace; + margin-top: 0; word-break: break-all; word-wrap: break-word; white-space: pre-line; } -@font-face { - font-family: coolFont; - src: url('ShareTechMono-Regular.ttf'); -} - .stderr { color: #F00; } \ No newline at end of file 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 @@ - + +
+