[Pushed] SCEditor - Duplicate tags after re-election. - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Development (https://community.mybb.com/forum-161.html) +--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html) +---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html) +----- Forum: Pushed (https://community.mybb.com/forum-183.html) +----- Thread: [Pushed] SCEditor - Duplicate tags after re-election. (/thread-184162.html) Pages:
1
2
|
SCEditor - Duplicate tags after re-election. - Snake_ - 2015-10-11 Hi, For some time now users reporting to me bug in editor. For example: if first select (ex. font-size), then again change this font - it not change BBCode, but adding next. GIF presents: It's hard to do with so many modify tags on tapatalk for example... RE: SCEditor - Duplicate tags after re-election. - Destroy666 - 2015-10-11 This specific case looks like a bug on our end indeed, since it seems to works fine on http://www.sceditor.com/ It applies only to the [/size] tag, so I guess it's connected with our custom BBCode: https://github.com/mybb/mybb/blob/feature/jscripts/bbcodes_sceditor.js#L77-L165 RE: SCEditor - Duplicate tags after re-election. - ATofighi - 2015-10-11 Hi, Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too. Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/2228 Thanks for contributing to MyBB! Regards, The MyBB Group RE: SCEditor - Duplicate tags after re-election. - mkm87 - 2016-03-06 Hi, This happens because at https://github.com/mybb/mybb/blob/feature/jscripts/bbcodes_sceditor.js, line 146, you have: Instead of the above, you should use : Using this way, it would not add extra unnecessary spans.Of course it would create <font .. instead, but using jquery you can change it to span. RE: SCEditor - Duplicate tags after re-election. - martec - 2016-03-06 (2016-03-06, 10:47 AM)mkm87 Wrote: Hi, i tried made something like in 13/10/2015 https://github.com/mybb/mybb/pull/2229/files but cause others bugs. And i tried understand core file of sceditor, but i not find anything. I not know what code in core that result in font tag. RE: SCEditor - Duplicate tags after re-election. - mkm87 - 2016-03-06 (2016-03-06, 03:27 PM)martec Wrote: i tried made something like in 13/10/2015 https://github.com/mybb/mybb/pull/2229/files The code that result in font tag is: editor.execCommand('fontsize' ... https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand -> fontSize I've spent/wasted a whole afternoon to try to understand how it works too, and it was this method. If you don't use execCommand, but <span.. instead, it will add additional <span.. tags if you re-apply, which is something unwanted. I do not use neither Mybb nor the sceditor's font-size default command so i can't help you right now with the bugs. Instead i use pixels as font-size, which i've posted here: http://community.mybb.com/thread-189611.html Maybe that code can help you fix it. RE: SCEditor - Duplicate tags after re-election. - martec - 2016-03-06 (2016-03-06, 04:42 PM)mkm87 Wrote: The code that result in font tag is: i thought that execCommand it was internal command, but appear that not. thanks for unravel the mystery. and i not know if this bug persist https://bugzilla.mozilla.org/show_bug.cgi?id=763859 , if not document.execCommand('styleWithCSS',false,true); is fix for this. EDIT: i tested here. Yes editor.execCommand('styleWithCSS', true); is solution for this. But only work in webkit/Blink. Not work in Gecko (FF). EDIT2: This really not fault or bug of SCEditor. I check here Redactor, and Redactor too add font tag, this happen why browser (FF, Edge etc...) not respect styleWithCSS. So what solution that xenforo used for this? Xenforo use css to "fix" this. Some like this:
So solution is use font tag in SCEditor and make correction using css like xenforo. RE: SCEditor - Duplicate tags after re-election. - Destroy666 - 2016-03-07 Feel free to edit your PR with that solution RE: SCEditor - Duplicate tags after re-election. - martec - 2016-03-07 (2016-03-07, 05:22 PM)Destroy666 Wrote: Feel free to edit your PR with that solution yes... i willl. now only in 1.8.8 correct? so not need rush. RE: SCEditor - Duplicate tags after re-election. - Destroy666 - 2016-03-07 Yes |