TinyMCE: wpeditimage: trim class

Don't add extra spaces to classes. It causes some tests in the TinyMCE QUnit test suite to fail.

Fixes #31764.

Built from https://develop.svn.wordpress.org/trunk@32592


git-svn-id: http://core.svn.wordpress.org/trunk@32562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ella Iseulde Van Dorpe 2015-05-25 06:35:28 +00:00
parent 4c37f68b79
commit 6e0e924de9
4 changed files with 5 additions and 5 deletions

View File

@ -2,6 +2,7 @@
tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
var toolbar, serializer,
each = tinymce.each,
trim = tinymce.trim,
iOS = tinymce.Env.iOS;
function isPlaceholder( node ) {
@ -95,8 +96,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
function parseShortcode( content ) {
return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
var id, align, classes, caption, img, width,
trim = tinymce.trim;
var id, align, classes, caption, img, width;
id = b.match( /id=['"]([^'"]*)['"] ?/ );
if ( id ) {
@ -865,7 +865,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
replacement = ' ' + align;
}
node.className = node.className.replace( / ?align(left|center|right|none)/g, '' ) + replacement;
node.className = trim( node.className.replace( / ?align(left|center|right|none)/g, '' ) + replacement );
editor.nodeChanged();
event.preventDefault();

File diff suppressed because one or more lines are too long

View File

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