Ticket #7944: 7944.patch

File 7944.patch, 1.8 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/enterkey/plugin.js

     
    5858                                }
    5959                        }
    6060                        // Don't split <pre> if we're in the middle of it, act as shift enter key.
    61                         else if ( !atBlockEnd && block && block.is( 'pre' ) )
    62                                 enterBr( editor, mode, range, forceMode );
     61                        else if ( block && block.is( 'pre' ) )
     62                        {
     63                                if ( !atBlockEnd )
     64                                        return enterBr( editor, mode, range, forceMode );
     65                        }
     66                        // Don't split caption block, like <caption> and <legend>. (#7944)
     67                        else if ( block && !CKEDITOR.dtd[ block.getName() ][ 'p' ] )
     68                                return enterBr( editor, mode, range, forceMode );
    6369
    6470                        // Determine the block element to be used.
    6571                        var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
  • _source/core/dom/elementpath.js

     
    66(function()
    77{
    88        // Elements that may be considered the "Block boundary" in an element path.
    9         var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1, legend:1 };
     9        var pathBlockElements = { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1, legend:1,caption:1 };
    1010
    1111        // Elements that may be considered the "Block limit" in an element path.
    12         var pathBlockLimitElements = { body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1,fieldset:1 };
     12        var pathBlockLimitElements = { body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,form:1,fieldset:1 };
    1313
    1414        // Check if an element contains any block element.
    1515        var checkHasBlock = function( element )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy