From b9d09cb165b17d7d9cbaddef7dc1a521f7ceb174 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Tue, 30 Jul 2019 14:12:40 +0000 Subject: [PATCH] console.js: reformatting fixes (Forum #102595) git-svn-id: https://svn.fhem.de/fhem/trunk@19920 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/console.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/fhem/www/pgm2/console.js b/fhem/www/pgm2/console.js index dc7bb703f..e00386414 100644 --- a/fhem/www/pgm2/console.js +++ b/fhem/www/pgm2/console.js @@ -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(/(.*)
[\r\n]+$/); // Strange stuff. - if(ma) { - new_content = ma[1]; - if(new_content.indexOf('<') != 0) { - var rTab = {'<':'<', '>':'>',' ':' '}; - new_content = new_content.replace(/[<> ]/g, function(a){return rTab[a]}); - } - new_content += '
'; - } - + var rTab = {'<':'<', '>':'>',' ':' '}; + new_content = new_content.replace(/(.*)
[\r\n]/g, function(all,p1) { + return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"
"; + }); $("#console").append(new_content); if(mustScroll)