command in dzVents
Code: Select all
dz.devices(1642).updateText('line 1'..'\n line 2')
Code: Select all
line1 line2
but I expected
Code: Select all
line1
line2
Moderator: leecollings
Code: Select all
dz.devices(1642).updateText('line 1'..'\n line 2')
Code: Select all
line1 line2
Code: Select all
line1
line2
Code: Select all
dz.devices(1642).updateText('line 1\n line 2')
Code: Select all
local textSensor = dz.devices(1642)
if textSensor then
local text = 'line1'..
'\n\n line2'
textSensor.updateText(text)
end
Code: Select all
dz.devices(1642).updateText('line 1<br>line 2')
Code: Select all
this.data = item.Data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br />$2');
if (this.data.indexOf("<br />") != -1) {
this.hasNewLine = true;
I asked AI what this should do and it came up with the following description:waltervl wrote: ↑Thursday 07 November 2024 23:23 Looking at this part of code in the floorplan it looks like it should work with line breaks.
https://github.com/domoticz/domoticz/bl ... s.js#L1891Code: Select all
this.data = item.Data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br />$2');
So.. <br /> is the way?!?In HTML (up to HTML 4): use <br>
In HTML 5: <br> is preferred, but <br/> and <br /> is also acceptable
In XHTML: <br /> is preferred. Can also use <br/> or <br></br>
Notes:
<br></br> is not valid in HTML 5, it will be thought of as two line breaks.
XHTML is case sensitive, HTML is not case sensitive.
For backward compatibility, some old browsers would parse XHTML as HTML and fail on <br/> but not <br />
Users browsing this forum: Google [Bot] and 1 guest