Thanks for reporting! I will remove the blank line in the next update. It’s very odd that a paragraph end tag is added – it doesn’t happen in my own install, nor have I received any reports from other users. Is it possible that your theme is doing this autop ? Blank lines are perfectly legal to use in js!
Actually, wpautop has built in functionality that should prevent this to happen in the first place:
https://developer.ww.wp.xz.cn/reference/functions/wpautop/
if ( $br ) {
$pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
}
So my guess is that it’s not core WordPress doing this…
Ewout
Thread Starter
peter
(@dewebbouwmeester)
Hi Ewout,
Thanks for your quick reply!
The plugin is part of quite a large (multisite) installation and there could very well be some other code interfering. I will try if i can find the culprit and let you know.
I’ll mark this issue as resolved, thanks.
Kind regards,
Peter
Thread Starter
peter
(@dewebbouwmeester)
Hi Ewout,
Thanks for pointing me at default wpautop formatting. It made me look at the code base and I indeed found a bespoke function that tempers with the content filters in such a way, that it causes the erroneous paragraph tags. I need to find a way to solve that.
As it turns out, this also seems to cause the other issue i reported, although I don’t quite understand why yet.
Kind regards,
Peter