Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/luci-base/htdocs/luci-static/resources/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@
if (typeof(s) == 'string' && !s.match(/[<>&]/))
return s;

const x = dom.elem(s) ? s : dom.parse(`<div>${s}</div>`);
const x = dom.elem(s) ? s.cloneNode(true) : dom.parse(`<div>${s}</div>`);

x.querySelectorAll('br').forEach((br) => {
x.replaceChild(document.createTextNode('\n'), br);
br.parentNode.replaceChild(document.createTextNode('\n'), br);
Comment thread
jjm2473 marked this conversation as resolved.
});

return (x.textContent ?? x.innerText ?? '').replace(/([ \t]*\n)+/g, '\n');
Expand Down Expand Up @@ -2757,7 +2757,7 @@
},


/**

Check warning on line 2760 in modules/luci-base/htdocs/luci-static/resources/form.js

View workflow job for this annotation

GitHub Actions / eslint

Missing JSDoc @PARAM "ev" declaration
* Clone the section_id, putting the clone immediately after if put_next
* is true. Optionally supply a name for the new section_id.
*
Expand Down