Changeset 32832
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
r32795 r32832 88 88 } 89 89 90 if ( ! child.nodeValue ) { 91 child = child.nextSibling; 92 } 93 90 94 if ( child !== node ) { 91 95 return; … … 110 114 111 115 editor.undoManager.transact( function() { 116 var $$parent; 117 112 118 if ( replace ) { 113 119 $$( node ).replaceWith( document.createTextNode( replace ) ); 114 120 } else { 115 $$( node.parentNode ).empty().append( '<br>' ); 121 $$parent = $$( node.parentNode ); 122 123 $$( node ).remove(); 124 125 if ( ! $$parent.html() ) { 126 $$parent.append( '<br>' ); 127 } 116 128 } 117 129 -
trunk/tests/qunit/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
r32706 r32832 78 78 } ); 79 79 80 QUnit.test( 'Ordered list with content. ', function( assert ) {80 QUnit.test( 'Ordered list with content. (1)', function( assert ) { 81 81 editor.setContent( '<p><strong>test</strong></p>' ); 82 82 editor.selection.setCursorLocation(); 83 84 type( '* ', function() { 85 assert.equal( editor.getContent(), '<ul>\n<li><strong>test</strong></li>\n</ul>' ); 86 }, assert.async() ); 87 } ); 88 89 QUnit.test( 'Ordered list with content. (2)', function( assert ) { 90 editor.setContent( '<p><strong>test</strong></p>' ); 91 editor.selection.setCursorLocation( editor.$( 'p' )[0], 0 ); 83 92 84 93 type( '* ', function() {
Note: See TracChangeset
for help on using the changeset viewer.