mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-02 11:21:57 +01:00
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:
parent
3c64d94ba9
commit
0fa4845eec
@ -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]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
2
wp-includes/js/mce-view.min.js
vendored
2
wp-includes/js/mce-view.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user