TinyMCE: prevent error in the wptextpattern plugin when the first child node in a paragraph is not a text node.

See #31441;
Built from https://develop.svn.wordpress.org/trunk@32960


git-svn-id: http://core.svn.wordpress.org/trunk@32931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-06-26 23:19:24 +00:00
parent 4857824377
commit b9e796a5c1
4 changed files with 6 additions and 2 deletions

View File

@ -88,6 +88,10 @@
}
}
if ( ! child ) {
return;
}
if ( ! child.nodeValue ) {
child = child.nextSibling;
}

View File

@ -1 +1 @@
!function(a,b){a.PluginManager.add("wptextpattern",function(c){function d(a,b){g.push({regExp:a,callback:b})}var e=c.$,f=a.util.VK,g=[],h=!1;d(/^[*-]\s/,function(){this.execCommand("InsertUnorderedList")}),d(/^1[.)]\s/,function(){this.execCommand("InsertOrderedList")}),d(/^>\s/,function(){this.formatter.toggle("blockquote")}),d(/^(#{2,6})\s/,function(){this.formatter.toggle("h"+arguments[1].length)}),c.on("selectionchange",function(){h=!1}),c.on("keydown",function(a){!h||a.keyCode!==f.BACKSPACE&&27!==a.keyCode||(c.undoManager.undo(),a.preventDefault())}),c.on("keyup",function(d){var i,j,k,l,m;if(d.keyCode===f.SPACEBAR&&(i=c.selection.getRng(),j=i.startContainer,j&&3===j.nodeType&&(k=j.nodeValue,l=c.dom.getParent(j,"p")))){for(;(m=l.firstChild)&&3!==m.nodeType;)l=m;m.nodeValue||(m=m.nextSibling),m===j&&a.each(g,function(a){var d,f=k.replace(a.regExp,function(){return d=arguments,""});if(k!==f&&i.startOffset===k.length-f.length)return c.undoManager.add(),c.undoManager.transact(function(){var b;f?e(j).replaceWith(document.createTextNode(f)):(b=e(j.parentNode),e(j).remove(),b.html()||b.append("<br>")),c.selection.setCursorLocation(l),a.callback.apply(c,d)}),b(function(){h=!0}),!1})}})})}(window.tinymce,window.setTimeout);
!function(a,b){a.PluginManager.add("wptextpattern",function(c){function d(a,b){g.push({regExp:a,callback:b})}var e=c.$,f=a.util.VK,g=[],h=!1;d(/^[*-]\s/,function(){this.execCommand("InsertUnorderedList")}),d(/^1[.)]\s/,function(){this.execCommand("InsertOrderedList")}),d(/^>\s/,function(){this.formatter.toggle("blockquote")}),d(/^(#{2,6})\s/,function(){this.formatter.toggle("h"+arguments[1].length)}),c.on("selectionchange",function(){h=!1}),c.on("keydown",function(a){!h||a.keyCode!==f.BACKSPACE&&27!==a.keyCode||(c.undoManager.undo(),a.preventDefault())}),c.on("keyup",function(d){var i,j,k,l,m;if(d.keyCode===f.SPACEBAR&&(i=c.selection.getRng(),j=i.startContainer,j&&3===j.nodeType&&(k=j.nodeValue,l=c.dom.getParent(j,"p")))){for(;(m=l.firstChild)&&3!==m.nodeType;)l=m;m&&(m.nodeValue||(m=m.nextSibling),m===j&&a.each(g,function(a){var d,f=k.replace(a.regExp,function(){return d=arguments,""});if(k!==f&&i.startOffset===k.length-f.length)return c.undoManager.add(),c.undoManager.transact(function(){var b;f?e(j).replaceWith(document.createTextNode(f)):(b=e(j.parentNode),e(j).remove(),b.html()||b.append("<br>")),c.selection.setCursorLocation(l),a.callback.apply(c,d)}),b(function(){h=!0}),!1}))}})})}(window.tinymce,window.setTimeout);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32959';
$wp_version = '4.3-alpha-32960';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.