Ticket #3526: 3526_3.patch

File 3526_3.patch, 1.2 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    371371                                                        },
    372372                                                        0 );
    373373                                        };
    374 
     374                                        var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|&#160;)\s*(:?<\/\1>)?\s*$/gi;
    375375                                        editor.addMode( 'wysiwyg',
    376376                                                {
    377377                                                        load : function( holderElement, data, isSnapshot )
     
    456456                                                                if ( editor.dataProcessor )
    457457                                                                        data = editor.dataProcessor.toDataFormat( data, ( editor.config.enterMode != CKEDITOR.ENTER_BR ) );
    458458
     459                                                                // Strip the last blank paragraph within document.
     460                                                                if ( editor.config.ignoreEmptyParagraph )
     461                                                                        data = data.replace( emptyParagraphRegexp, '' );
     462
    459463                                                                return data;
    460464                                                        },
    461465
     
    533537 * config.disableNativeSpellChecker = false;
    534538 */
    535539CKEDITOR.config.disableNativeSpellChecker = true;
     540/**
     541 * The editor will post an empty value ("") if you have just an empty paragraph on it, like this:
     542 * @example
     543 * <p></p>
     544 * <p><br /></p>
     545 * <p><b></b></p>
     546 */
     547CKEDITOR.config.ignoreEmptyParagraph = true;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy