From 52a11fd862c0f8dd8ae38b738a628ff66788e3f3 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 10 May 2021 07:55:41 +0000 Subject: [PATCH] console.js: fix html without
(Forum #120914) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24406 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- www/pgm2/console.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/www/pgm2/console.js b/www/pgm2/console.js index 62ce79d2d..570b081ae 100644 --- a/www/pgm2/console.js +++ b/www/pgm2/console.js @@ -59,7 +59,11 @@ consUpdate(evt) } if(new_content == undefined || new_content.length == 0) return; - log("Console Rcvd: "+new_content); + if(new_content.length < 120) + log("console Rcvd: "+new_content); + else + log("console Rcvd: "+new_content.substr(0,120)+ + "..., truncated, original length "+new_content.length); // Extract the FHEM-Log, to avoid escaping its formatting (Forum #104842) var logContent = ""; @@ -70,12 +74,11 @@ consUpdate(evt) return ""; }); - // replace space with nbsp to preserve formatting var isTa = $("#console").is("textarea"); // 102773 - new_content = new_content.replace(/(.*)
[\r\n]/g, function(all,p1) { - return p1.replace(/[<> ]/g, function(a){return rTab[a]})+(isTa?"\n":"
"); - }); - $("#console").append(logContent+new_content); + var ncA = new_content.split(/
[\r\n]/); + for(var i1=0; i1 ]/g, function(a){return rTab[a]}); + $("#console").append(logContent+ncA.join(isTa?"\n":"
"); if(mustScroll) $("#console").scrollTop($("#console")[0].scrollHeight);