console.js: some formatting
git-svn-id: https://svn.fhem.de/fhem/trunk@19921 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -60,6 +60,7 @@ 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);
|
||||||
|
// replace space with nbsp to preserve formatting
|
||||||
var rTab = {'<':'<', '>':'>',' ':' '};
|
var rTab = {'<':'<', '>':'>',' ':' '};
|
||||||
new_content = new_content.replace(/(.*)<br>[\r\n]/g, function(all,p1) {
|
new_content = new_content.replace(/(.*)<br>[\r\n]/g, function(all,p1) {
|
||||||
return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"<br>";
|
return p1.replace(/[<> ]/g, function(a){return rTab[a]})+"<br>";
|
||||||
|
|||||||
Reference in New Issue
Block a user