console.js: some formatting

git-svn-id: https://svn.fhem.de/fhem/trunk@19921 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2019-07-30 17:49:51 +00:00
parent b9d09cb165
commit d241988fe0

View File

@@ -60,6 +60,7 @@ consUpdate(evt)
if(new_content == undefined || new_content.length == 0)
return;
log("Console Rcvd: "+new_content);
// replace space with nbsp to preserve formatting
var rTab = {'<':'&lt;', '>':'&gt;',' ':'&nbsp;'};
new_content = new_content.replace(/(.*)<br>[\r\n]/g, function(all,p1) {
return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"<br>";