diff --git a/fhem/www/pgm2/console.js b/fhem/www/pgm2/console.js
index e00386414..816938f31 100644
--- a/fhem/www/pgm2/console.js
+++ b/fhem/www/pgm2/console.js
@@ -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 = {'<':'<', '>':'>',' ':' '};
new_content = new_content.replace(/(.*)
[\r\n]/g, function(all,p1) {
return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"
";