فهرست منبع

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

Similar to the behavior of the Parserus parser.
Visman 2 سال پیش
والد
کامیت
2e4941b857
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      public/js/sc/formats/bbcode.js

+ 3 - 0
public/js/sc/formats/bbcode.js

@@ -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(