Confirmed Copy & paste of plain bb-code removes newlines

Xon

Well-known member
Licensed customer
Affected version
2.3.14
Copying the following text;
1

2

3

pastes as;
[plain]123[/plain]

Instead of the expected;
[plain]1

2

3
[/plain]

The issue stems from the uses textContent which strips newlines;
JavaScript:
div.querySelectorAll('.bbPlain').forEach(el =>
{
el.outerHTML = `[PLAIN]${ XF.htmlspecialchars(el.textContent) }[/PLAIN]`
})
 
Last edited:
Back
Top Bottom