mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
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:
parent
4c37f68b79
commit
6e0e924de9
@ -2,6 +2,7 @@
|
|||||||
tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||||
var toolbar, serializer,
|
var toolbar, serializer,
|
||||||
each = tinymce.each,
|
each = tinymce.each,
|
||||||
|
trim = tinymce.trim,
|
||||||
iOS = tinymce.Env.iOS;
|
iOS = tinymce.Env.iOS;
|
||||||
|
|
||||||
function isPlaceholder( node ) {
|
function isPlaceholder( node ) {
|
||||||
@ -95,8 +96,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||||||
|
|
||||||
function parseShortcode( content ) {
|
function parseShortcode( content ) {
|
||||||
return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
|
return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
|
||||||
var id, align, classes, caption, img, width,
|
var id, align, classes, caption, img, width;
|
||||||
trim = tinymce.trim;
|
|
||||||
|
|
||||||
id = b.match( /id=['"]([^'"]*)['"] ?/ );
|
id = b.match( /id=['"]([^'"]*)['"] ?/ );
|
||||||
if ( id ) {
|
if ( id ) {
|
||||||
@ -865,7 +865,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||||||
replacement = ' ' + align;
|
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();
|
editor.nodeChanged();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user