TinyMCE wpView: don't insert nested paragraphs when inserting embeddable URLs. Props iseulde, fixes #29526.
git-svn-id: https://develop.svn.wordpress.org/trunk@31485 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
34fca78f68
commit
928ba6848c
|
@ -877,7 +877,7 @@ window.wp = window.wp || {};
|
|||
|
||||
wp.mce.views.register( 'embedURL', _.extend( {}, wp.mce.embedMixin, {
|
||||
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 ) );
|
||||
|
||||
if ( ! match ) {
|
||||
|
@ -885,10 +885,10 @@ window.wp = window.wp || {};
|
|||
}
|
||||
|
||||
return {
|
||||
index: match.index,
|
||||
content: match[0],
|
||||
index: match.index + match[1].length,
|
||||
content: match[2],
|
||||
options: {
|
||||
url: match[1]
|
||||
url: match[2]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue