mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
console.js: fix multiline FHEM-Log (Forum #122316)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24820 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
97d99f1a7c
commit
11792176e2
@ -67,10 +67,13 @@ consUpdate(evt)
|
|||||||
|
|
||||||
// Extract the FHEM-Log, to avoid escaping its formatting (Forum #104842)
|
// Extract the FHEM-Log, to avoid escaping its formatting (Forum #104842)
|
||||||
var logContent = "";
|
var logContent = "";
|
||||||
var rTab = {'<':'<', '>':'>',' ':' '};
|
var rTab = {'<':'<', '>':'>',' ':' ', '\n':'<br>' };
|
||||||
new_content = new_content.replace(/(<div class='fhemlog'>)(.*?)(<\/div>)/g,
|
new_content = new_content.replace(
|
||||||
|
/(<div class='fhemlog'>)([\s\S]*?)(<\/div>)/gm,
|
||||||
function(all, div1, msg, div2) {
|
function(all, div1, msg, div2) {
|
||||||
logContent += div1+msg.replace(/[<> ]/g, function(a){return rTab[a]})+div2;
|
logContent += div1+
|
||||||
|
msg.replace(/[<> \n]/g, function(a){return rTab[a]})+
|
||||||
|
div2;
|
||||||
return "";
|
return "";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user