2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +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)
return;
log("Console Rcvd: "+new_content);
var ma = new_content.match(/(.*)<br>[\r\n]+$/); // Strange stuff.
if(ma) {
new_content = ma[1];
if(new_content.indexOf('<') != 0) {
var rTab = {'<':'&lt;', '>':'&gt;',' ':'&nbsp;'};
new_content = new_content.replace(/[<> ]/g, function(a){return rTab[a]});
}
new_content += '<br>';
}
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>";
});
$("#console").append(new_content);
if(mustScroll)