fix: escape newline in JS string literal (\n vs literal newline)

This commit is contained in:
Oliver Hofmann 2026-05-17 13:28:58 +02:00
parent 98274d0917
commit ad0ed7528c

View File

@ -57,7 +57,7 @@ _POLL_JS = """() => {
// which includes sender name and timestamp
const pEls = msg.querySelectorAll('p');
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();
const id = msg.getAttribute('id') || (sender + '_' + text.substring(0, 40));
msgs.push({ sender, text, id });