TinyMCE wpView: don't insert nested paragraphs when inserting embeddable URLs. Props iseulde, fixes #29526.

Built from https://develop.svn.wordpress.org/trunk@31485


git-svn-id: http://core.svn.wordpress.org/trunk@31466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-02-20 23:17:27 +00:00
parent 3c64d94ba9
commit 0fa4845eec
3 changed files with 6 additions and 6 deletions

View File

@ -877,7 +877,7 @@ window.wp = window.wp || {};
wp.mce.views.register( 'embedURL', _.extend( {}, wp.mce.embedMixin, { wp.mce.views.register( 'embedURL', _.extend( {}, wp.mce.embedMixin, {
toView: function( content ) { toView: function( content ) {
var re = /(?:^|<p>)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi, var re = /(^|<p>)(https?:\/\/[^\s"]+?)(<\/p>\s*|$)/gi,
match = re.exec( tinymce.trim( content ) ); match = re.exec( tinymce.trim( content ) );
if ( ! match ) { if ( ! match ) {
@ -885,10 +885,10 @@ window.wp = window.wp || {};
} }
return { return {
index: match.index, index: match.index + match[1].length,
content: match[0], content: match[2],
options: { options: {
url: match[1] url: match[2]
} }
}; };
} }

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31484'; $wp_version = '4.2-alpha-31485';
/** /**
* 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.