Make WordPress Core

Changeset 31485


Ignore:
Timestamp:
02/20/2015 11:16:34 PM (9 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r31466 r31485  
    878878    wp.mce.views.register( 'embedURL', _.extend( {}, wp.mce.embedMixin, {
    879879        toView: function( content ) {
    880             var re = /(?:^|<p>)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi,
     880            var re = /(^|<p>)(https?:\/\/[^\s"]+?)(<\/p>\s*|$)/gi,
    881881                match = re.exec( tinymce.trim( content ) );
    882882
     
    886886
    887887            return {
    888                 index: match.index,
    889                 content: match[0],
     888                index: match.index + match[1].length,
     889                content: match[2],
    890890                options: {
    891                     url: match[1]
     891                    url: match[2]
    892892                }
    893893            };
Note: See TracChangeset for help on using the changeset viewer.