Remove under one empty line at the beginning and end of the content

Similar to the behavior of the Parserus parser.
This commit is contained in:
Visman 2023-04-09 14:23:46 +07:00
parent 9fcee28c05
commit 2e4941b857

View file

@ -1783,6 +1783,9 @@
content += '<br />'; content += '<br />';
} }
// Visman - удалить под одной пустой строке в начале и конце содержимого
content = content.replace(/^\x20*<br \/>/, '').replace(/<br \/>\x20*$/, '');
if (!isFunction(bbcode.html)) { if (!isFunction(bbcode.html)) {
token.attrs['0'] = content; token.attrs['0'] = content;
html = formatBBCodeString( html = formatBBCodeString(