2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

console.js: reformatting fixes (Forum #102595)

git-svn-id: https://svn.fhem.de/fhem/trunk@19920 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-07-30 14:12:40 +00:00
parent f8754d422d
commit 382d99f5ba

View File

@ -60,16 +60,10 @@ consUpdate(evt)
if(new_content == undefined || new_content.length == 0) if(new_content == undefined || new_content.length == 0)
return; return;
log("Console Rcvd: "+new_content); log("Console Rcvd: "+new_content);
var ma = new_content.match(/(.*)<br>[\r\n]+$/); // Strange stuff. var rTab = {'<':'&lt;', '>':'&gt;',' ':'&nbsp;'};
if(ma) { new_content = new_content.replace(/(.*)<br>[\r\n]/g, function(all,p1) {
new_content = ma[1]; return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"<br>";
if(new_content.indexOf('<') != 0) { });
var rTab = {'<':'&lt;', '>':'&gt;',' ':'&nbsp;'};
new_content = new_content.replace(/[<> ]/g, function(a){return rTab[a]});
}
new_content += '<br>';
}
$("#console").append(new_content); $("#console").append(new_content);
if(mustScroll) if(mustScroll)