Reproduction steps:
In message editor, center your text.
Preview your post OR send your message.
Notice that your text isn't centered anymore.
If you write align=center yourself, it works. If you use button for it, it doesn't.
Original thread: 1.8.20 Editor Center issue
maybe the sceditor doesn't full compatible with jquery 3.
maybe need update sceditor to 2.1 and to do changes like that smf did.
h ttps://github.com/SimpleMachines/SMF2.1/commit/6b12e2ec747cd51fb5f1bdc9c50c8cbacbd79b44#diff-c962f66d2fef87254e2ffaf9b1f07e1c
or change mybb default editor to bbcode editor like mybb 1.6. complicated for us to offer support to abandoned libraries or practically no support for bbcode plugin like tinymce and ckeditor .
for me if want wysiwyg editor, so use extension, like phpbb.
It seems that SCEditor itself has this bug. It's not related to MyBB (I spent about 1,5 hour searching what could possibly create this issue).
For now I tried to rewrite align in other way, tried to remove all MyBB BBCodes. Nothing changed. Even SCEditor built-in bbcodes are not able to change centered text into [center]text[/center] code. (Yes, this is standard alignment bbcode, and yes it technically works for MyBB too). So it seems that it is required to update SCEditor to version 2.0 or higher or change editor to other one. Also I'd like to point that adding any custom bbcodes that require some custom processing is really hard with SCEditor.
Edit: Okay I Also tried SCEditor 1.5.2 as standalone thing and there center code works fine. So it seems that something in MyBB causes this issue, but for now I can't possibly find anything that could cause such a problem.
We’re planning on upgrading SCEditor to the latest version in 1.8.21, along with upgrading jQuery to the latest version.
We can’t really change editors in a minor point release.
On 2 Mar 2019, at 23:18, MinusPL notifications@github.com wrote:
It seems that SCEditor itself has this bug. It's not related to MyBB (I spent about 1,5 hour searching what could possibly create this issue).
For now I tried to rewrite align in other way, tried to remove all MyBB BBCodes. Nothing changed. Even SCEditor built-in bbcodes are not able to change centered text into [center]text[/center] code. (Yes, this is standard alignment bbcode, and yes it technically works for MyBB too). So it seems that it is required to update SCEditor to version 2.0 or higher or change editor to other one. Also I'd like to point that adding any custom bbcodes that require some custom processing is really hard with SCEditor.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Yeah it won't be a good idea to change editor to other one. I'll continue to look where this issue has originated. It's weird that only centering doesn't work. And as I noted in my previous comment - SCEditor 1.5.2 is working properly as standalone thing, but when used in MyBB centering suddenly stops working.
Apparently this issue has been introduced in v.1.5.2 where a function for getting WYSIWYG editors HTML value started cloning the code.
file: "jquery.sceditor.bbcode.js" line 2145 to 2151.
var $tmp = $('<div>')
.appendTo(document.body)
.append($($wysiwygBody[0].childNodes).clone());
dom.fixNesting($tmp[0]);
html = $tmp.html();
Earlier it was using the raw code:
html = $wysiwygBody.html();
So if we use:
if (filter !== false && pluginManager.hasHandler('toSource')) {
html = pluginManager.callOnlyFirst('toSource', html, $wysiwygBody);
}
in place of:
if (filter !== false && pluginManager.hasHandler('toSource')) {
html = pluginManager.callOnlyFirst('toSource', html, $tmp);
}
Issue gets resolved.
Strange, it happens with center only, not left, right or justify.
May be author @samclarke can put some light.