fix: escape newline in JS string literal (\n vs literal newline)
This commit is contained in:
parent
98274d0917
commit
ad0ed7528c
@ -57,7 +57,7 @@ _POLL_JS = """() => {
|
|||||||
// which includes sender name and timestamp
|
// which includes sender name and timestamp
|
||||||
const pEls = msg.querySelectorAll('p');
|
const pEls = msg.querySelectorAll('p');
|
||||||
const text = pEls.length > 0
|
const text = pEls.length > 0
|
||||||
? Array.from(pEls).map(p => p.innerText.trim()).filter(t => t).join('\n')
|
? Array.from(pEls).map(p => p.innerText.trim()).filter(t => t).join('\\n')
|
||||||
: msg.innerText.trim();
|
: msg.innerText.trim();
|
||||||
const id = msg.getAttribute('id') || (sender + '_' + text.substring(0, 40));
|
const id = msg.getAttribute('id') || (sender + '_' + text.substring(0, 40));
|
||||||
msgs.push({ sender, text, id });
|
msgs.push({ sender, text, id });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user