From 134f3de3c9b5b68670f753e2cf647db5c7d11a88 Mon Sep 17 00:00:00 2001 From: mattpass Date: Tue, 7 Jul 2020 14:53:57 +0100 Subject: [PATCH] Escape message output from Prettier, most recent first, clear placeholder --- assets/js/icecoder.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 81a6a2f..f91c67d 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -2028,7 +2028,7 @@ var ICEcoder = { )); } catch(err) { get("toolLinkOutput").className = "highlight error"; - this.outputMsg('
Syntax error in ' + this.openFiles[this.selectedTab - 1].replace(iceRoot, "") + '
\n' + err.message); + this.outputMsg('
Syntax error in ' + this.openFiles[this.selectedTab - 1].replace(iceRoot, "") + '
\n' + err.message.replace(//g, '>')); } } setTimeout(function() { @@ -3718,7 +3718,11 @@ var ICEcoder = { // Show a message outputMsg: function(msg) { - this.output.innerHTML += msg + "
"; + // If only placeholder, clear that + if ("Output
via ICEcoder.output(message);

" === this.output.innerHTML) { + this.output.innerHTML = ""; + } + this.output.innerHTML = msg + "

" + this.output.innerHTML + "

"; }, // Show a message