From 2e4941b857364eb5e59ff65bd53d09ae700c7ce4 Mon Sep 17 00:00:00 2001 From: Visman Date: Sun, 9 Apr 2023 14:23:46 +0700 Subject: [PATCH] Remove under one empty line at the beginning and end of the content Similar to the behavior of the Parserus parser. --- public/js/sc/formats/bbcode.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/js/sc/formats/bbcode.js b/public/js/sc/formats/bbcode.js index 4a25c2f5..729217ce 100644 --- a/public/js/sc/formats/bbcode.js +++ b/public/js/sc/formats/bbcode.js @@ -1783,6 +1783,9 @@ content += '
'; } + // Visman - удалить под одной пустой строке в начале и конце содержимого + content = content.replace(/^\x20*
/, '').replace(/
\x20*$/, ''); + if (!isFunction(bbcode.html)) { token.attrs['0'] = content; html = formatBBCodeString(