TinyMCE: when parsing [caption] and the width attribute is missing, recreate it from the image tag width, fixes #23103

git-svn-id: https://develop.svn.wordpress.org/trunk@27426 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-03-06 00:12:08 +00:00
parent 1de1f27249
commit e3b214f047
1 changed files with 8 additions and 1 deletions

View File

@ -34,7 +34,14 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
id = ( id && id[1] ) ? id[1] : '';
cls = ( cls && cls[1] ) ? cls[1] : 'alignnone';
w = ( w && w[1] ) ? w[1] : '';
if ( ! w && img ) {
w = img.match( /width=['"]([0-9]*)['"]/ );
}
if ( w && w[1] ) {
w = w[1];
}
if ( ! w || ! cap ) {
return c;