Ticket #7065: 7065.patch

File 7065.patch, 974 bytes (added by Garry Yao, 12 years ago)
  • _source/plugins/styles/plugin.js

     
    965965         */
    966966        function splitIntoPres( preBlock )
    967967        {
    968                 // Exclude the ones at header OR at tail,
    969                 // and ignore bookmark content between them.
    970                 var duoBrRegex = /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,
     968                // Two consequent line-breaks make a split, be ware of bookmarks.
     969                var duoBrRegex = /(?:(\n|<br[^>]*?>)((:?<span[^>]+data-cke-bookmark.*?\/span>)*))\1/gi,
    971970                        blockName = preBlock.getName(),
    972971                        splitedHtml = replace( preBlock.getOuterHtml(),
    973972                                duoBrRegex,
    974                                 function( match, charBefore, bookmark )
     973                                function( match, linebreak, bookmark )
    975974                                {
    976                                   return charBefore + '</pre>' + bookmark + '<pre>';
     975                                  return bookmark + '</pre><pre>';
    977976                                } );
    978977
    979978                var pres = [];
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy