Topic on Extension talk:WYSIWYG

Jump to navigation Jump to search

Bug with division text format and line breaks

Vifsorbier (talkcontribs)

I'm using WYSIWYG #6 along with MW 1.31 (see exact specifications at the end of this post)

it works well except one little annoying bug :

When I want to edit a page the blocs containing text in the Division text format are switched to Normal text format and it looses line breaks

See those two pictures to illustrate the problem

Picture for step 1

Picture for step 2

This bug is even more annoying since when creating a new page it's the Division text format which is used by default.

I tried to tweak CKeditor config.js file to remove Division text format but without success.

I didn't find any instructions about how to make Normal text format the default text format used instead of Division text format, please tell me if you know how to do this.

Also this bug messes up pages I created with MW 1.30 and an older version of WISIWYG extension (I installed it around february 2018)

I exported those pages and imported them to the new wiki.

Those pages contain lots of layered div blocks and when I try to edit those pages all div blocks are merged into one, losing line breaks.

I found a workaround by using the Remove Format button, it seems like by doing that the div blocks are stuck and will not be merged into one even when saving changes. By looking closer I understood that this trick converts all the <div class="mw-parser-output"> elements into simple <div> elements.

It's not a very elegant solution but it's handy enough for me.

I copy-paste here more detailed infos about what is installed on my mediawiki
MediaWiki     1.31.1

PHP     7.3.0 (fpm-fcgi)

MySQL     5.7.23-23-log

ICU     57.1

WikiEditor    0.5.1

WYSIWYG editor    Wysiwyg 1.5.6_0 [B551+18.09.2018], CKEditor 4.6.2 (revision 20af917)
Vifsorbier (talkcontribs)

I almost forgot to search logs for errors

Here is what I got when I turn on displaying PHP errors and trying to edit a page

Notice: Undefined property: CKeditorEditPage::$isCssJsSubpage in /srv/data/web/vhosts/ on line 35

Warning: Parameter 1 to CKeditor_MediaWiki::onEditPageBeforePreviewText() expected to be a reference, value given in /srv/data/web/vhosts/ on line 177

Warning: Parameter 1 to CKeditor_MediaWiki::onEditPagePreviewTextEnd() expected to be a reference, value given in /srv/data/web/vhosts/ on line 177

and here are extracts from the corresponding files (designated lines are in bold)

CKeditorEditPage.body.php function getPreviewText() {

       if( !$this->isCssJsSubpage ) {

           wfRunHooks( 'EditPageBeforePreviewText', array( &$this, $this->previewOnOpen() ) );

           $result = parent::getPreviewText();

           wfRunHooks( 'EditPagePreviewTextEnd', array( &$this, $this->previewOnOpen() ) );

       } else {

           $result = parent::getPreviewText();


       return $result;



// Call the hook.

       $hook_args = array_merge( $hook, $args );

       return call_user_func_array( $callback, $hook_args );

I also activated SQL errors log but it did not show anything

Reply to "Bug with division text format and line breaks"