From 84827c87dca0011870b7b6a6f0a9654a12a4a91c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 14 Jan 2013 17:34:45 +0000 Subject: [PATCH] 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 --- wp-includes/js/media-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/wp-includes/js/media-editor.js b/wp-includes/js/media-editor.js index 80494ba17f..15eff8da5c 100644 --- a/wp-includes/js/media-editor.js +++ b/wp-includes/js/media-editor.js @@ -18,6 +18,7 @@ if ( 'image' === props.type && ! props.alt ) { props.alt = props.caption || props.title || ''; props.alt = props.alt.replace( /<\/?[^>]+>/g, '' ); + props.alt = props.alt.replace( /[\r\n]+/g, ' ' ); } return props;