Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
406 views
in Plugins by
edited by

When I post answer on my website with several paragraphs they are separated with <div> tags instead of <p>, as expected. However this appears only after I insert headings:

But if I click edit on this answer and save it without any changes, all div's will be replaced with <p> tags:

This happens only after headings.

I'm using CKEditor WYSIWYG plugin and a bit confused with such behavior.

What should I do to fix it?

Q2A version: 1.8.3
by
Anyone please answer
by
I've updated Ckeditor 4 plugin to the latest version, and made some changes to config and this bug disappeared.

Here is my config.js:

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
    config.toolbar = [
        { name: 'document', items: [] },
        { name: 'styles', items: [ 'Format' ] },
        { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat' ] },
        { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-' ] },
        { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
        { name: 'insert', items: [ 'Image', 'Smiley'] },
    ];
    config.format_tags = 'p;h2;h3';
    config.autoParagraph = false;
    config.enterMode = CKEDITOR.ENTER_P;

    // Make dialogs simpler
    config.removeDialogTabs = 'image:advanced;link:advanced;table:advanced';

    config.entities = false;
    // Prevent blank paragraphs
    config.fillEmptyBlocks = false;

    // Use native spell checking (note: Ctrl+right-click is required for native context menu)
    config.disableNativeSpellChecker = false;

    // Add custom CSS
    config.contentsCss = [CKEDITOR.getUrl('contents.css'), CKEDITOR.getUrl('contents-custom.css')];
};

Please log in or register to answer this question.

...