Ticket #3585: 3585_3.patch

File 3585_3.patch, 1.8 KB (added by Garry Yao, 15 years ago)
  • _source/tests/core/htmlparser/fragment.html

     
    151151                                                '<p><b>Test</b></p><script type="test">var a = "<A Href=xxx>Testing</ A>";\nGo();<\/script>' );
    152152                },
    153153
     154                test_ticket_3585 : function()
     155                {
     156                        testParser(     '<p><br />\t\r\n</p>',
     157                                                '<p><br /></p>' );
     158                },
     159
     160                test_ticket_3585_1 : function()
     161                {
     162                        testParser(     '<p><br />text\t\r\n</p>',
     163                                                '<p><br />text</p>' );
     164                },
     165
     166
     167                test_ticket_3585_2 : function()
     168                {
     169                        testParser(     '<b>inline </b>\n<p>paragraph\t\r\n</p>\t\r\n',
     170                                                '<p><b>inline </b></p><p>paragraph</p>' );
     171                },
     172
    154173                name : document.title
    155174        };
    156175})() );
    157176
    158177// Uncomment the following to run a single test.
    159 // window.onload = tc.test_ticket_3195_2;
     178// window.onload = tc.test_ticket_3585_2;
    160179
    161180        //]]>
    162181        </script>
  • _source/core/htmlparser/fragment.js

     
    116116                                        currentNode = savedCurrent;
    117117                        }
    118118
     119                        // Rtrim empty spaces on block end boundary. (#3585)
     120                        if ( element._.isBlockLike )
     121                        {
     122
     123                                var length = element.children.length,
     124                                        lastChild = element.children[ length - 1 ],
     125                                        text;
     126                                if ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT )
     127                                {
     128                                        if ( !( text = CKEDITOR.tools.rtrim( lastChild.value ) ) )
     129                                                element.children.length = length -1;
     130                                        else
     131                                                lastChild.value = text;
     132                                }
     133                        }
     134
    119135                        target.add( element );
    120136
    121137                        if ( element.returnPoint )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy