RSS Feed/News Copy & paste of plain bb-code removes newlines

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
34,712
Points
823

Reputation:

Copying the following text;
1

2

3

pastes as;
123

Instead of the expected above text.

The issue stems from the uses textContent which strips newlines;
JavaScript:

Code:
div.querySelectorAll('.bbPlain').forEach(el =>
{
el.outerHTML = `[PLAIN]${ XF.htmlspecialchars(el.textContent) }[/PLAIN]`
})

Continue reading...
 
Status
Not open for further replies.
Top