Media: when copying from "caption" (textarea) to "alt" (text input) also remove line breaks, props kovshenin, fixes #23176 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@23298 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2013-01-14 17:34:45 +00:00
parent f4beefbb88
commit 84827c87dc

View File

@ -18,6 +18,7 @@
if ( 'image' === props.type && ! props.alt ) { if ( 'image' === props.type && ! props.alt ) {
props.alt = props.caption || props.title || ''; props.alt = props.caption || props.title || '';
props.alt = props.alt.replace( /<\/?[^>]+>/g, '' ); props.alt = props.alt.replace( /<\/?[^>]+>/g, '' );
props.alt = props.alt.replace( /[\r\n]+/g, ' ' );
} }
return props; return props;