mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
TinyMCE: wptextpattern: fix issue that removes content
* If the resulting text node is empty, don't remove all the content from the paragraph. * If there's an empty text node at the start of the paragraph, ignore it and consider the next node to be the start. See #31441. git-svn-id: https://develop.svn.wordpress.org/trunk@32832 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
}, assert.async() );
|
||||
} );
|
||||
|
||||
QUnit.test( 'Ordered list with content.', function( assert ) {
|
||||
QUnit.test( 'Ordered list with content. (1)', function( assert ) {
|
||||
editor.setContent( '<p><strong>test</strong></p>' );
|
||||
editor.selection.setCursorLocation();
|
||||
|
||||
@@ -86,6 +86,15 @@
|
||||
}, assert.async() );
|
||||
} );
|
||||
|
||||
QUnit.test( 'Ordered list with content. (2)', function( assert ) {
|
||||
editor.setContent( '<p><strong>test</strong></p>' );
|
||||
editor.selection.setCursorLocation( editor.$( 'p' )[0], 0 );
|
||||
|
||||
type( '* ', function() {
|
||||
assert.equal( editor.getContent(), '<ul>\n<li><strong>test</strong></li>\n</ul>' );
|
||||
}, assert.async() );
|
||||
} );
|
||||
|
||||
QUnit.test( 'Only transform inside a P tag.', function( assert ) {
|
||||
editor.setContent( '<h1>test</h1>' );
|
||||
editor.selection.setCursorLocation();
|
||||
|
||||
Reference in New Issue
Block a user