TinyMCE: preserve empty image alt attributes.

Props afercia.
Fixes #39912 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40110


git-svn-id: http://core.svn.wordpress.org/trunk@40047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-02-24 20:41:43 +00:00
parent bc1fc91ec8
commit 9c1d14b875
4 changed files with 6 additions and 4 deletions

View File

@ -382,13 +382,15 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
src: imageData.url,
width: width || null,
height: height || null,
alt: imageData.alt,
title: imageData.title || null,
'class': classes.join( ' ' ) || null
};
dom.setAttribs( imageNode, attrs );
// Preserve empty alt attributes.
editor.$( imageNode ).attr( 'alt', imageData.alt || '' );
linkAttrs = {
href: imageData.linkUrl,
rel: imageData.linkRel || null,
@ -1026,7 +1028,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
editor.on( 'beforeGetContent', function( event ) {
if ( event.format !== 'raw' ) {
editor.$( 'img[id="__wp-temp-img-id"]' ).attr( 'id', null );
}
}
});
editor.on( 'BeforeSetContent', function( event ) {

File diff suppressed because one or more lines are too long

View File

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