تعرضت لنفس المُشكلة و لاحظت أنها تظهر عند إستعمال مُلحق تحويل محرر SCEditor من BBcode إلى HTML.
أشارككم الحل الذي وجدته و أتمنى من الأخ @Soliman التأكد من فاعليته و سلامة إستعماله.
لوحة الإدارة > التحكم بالبرامج المساعدة (HOOKS) > تحرير template_class_end
تغيير المُحتوى كاملا بالكود التالي:
CODE
if ($filename == 'editor_js'
or $filename == 'fast_reply_js'
or $filename == 'fast_edit')
{
$string = str_replace("format: 'bbcode'","format: 'xhtml'",$string);
$string = str_replace('look/sceditor/minified/formats/bbcode.js"','look/sceditor/minified/formats/bbcode.js?v=58367"',$string);
// JS cleanup for filler paragraph and trailing <br> in .text containers
$cleanup_js = <<<EOT
document.addEventListener('DOMContentLoaded', function() {
// Remove <p class="sceditor-nlf"><br></p>
document.querySelectorAll('p.sceditor-nlf').forEach(p => p.remove());
// Remove all trailing <br> tags at the end of .text elements
document.querySelectorAll('.text').forEach(el => {
let html = el.innerHTML;
html = html.replace(/(<br\s*\/?>\\s*)+$/gi, '');
el.innerHTML = html;
});
});
EOT;
$string .= "<script>{$cleanup_js}</script>";
}