Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#33335 closed defect (bug) (wontfix)

embedURL wp-view not detecting in div, only p tag.

Reported by: programmin's profile programmin Owned by: iseulde's profile iseulde
Milestone: Priority: normal
Severity: normal Version: 4.3
Component: Editor Keywords: reporter-feedback
Focuses: ui, javascript, administration Cc:

Description

As described here, there's a cool link-edit-popup in 4.3: https://make.wordpress.org/core/2015/08/01/editor-enhancements-in-4-3-%e2%9c%a8/

Unfortunately if the post has divs instead of paragraphs, for example if you have MCE set to forced_root_block = 'div', you never see these. In wp-views.js you see it's matching paragraphs:

	views.register( 'embedURL', _.extend( {}, embed, {
		match: function( content ) {
			var re = /(^|<p>)(https?:\/\/[^\s"]+?)(<\/p>\s*|$)/gi,
				match = re.exec( content );

			if ( match ) {
				return {
					index: match.index + match[1].length,
					content: match[2],
					options: {
						url: true
					}
				};
			}
		}
	} ) );

Change History (8)

#1 @dd32
10 years ago

  • Milestone changed from Awaiting Review to 4.3

Moving to 4.3 for review.

#2 @obenland
10 years ago

  • Owner set to iseulde
  • Status changed from new to reviewing

#3 @iseulde
10 years ago

  • Keywords reporter-feedback added

I'm not sure what mce-view.js has to do with the inline toolbar. I also tried <div>This is a <a href="http://w.org">link</a>.</div>, but the inline toolbar shows. Could you maybe give us some content or a way to reproduce this? Thanks!

#4 @azaozz
10 years ago

Also note that using DIVs as "root blocks" is not supported in WordPress. There is also a warning against it in the TinyMCE config help: http://www.tinymce.com/wiki.php/Configuration:forced_root_block

This ticket was mentioned in Slack in #core by obenland. View the logs.


10 years ago

This ticket was mentioned in Slack in #core by obenland. View the logs.


10 years ago

#7 @azaozz
10 years ago

  • Milestone changed from 4.3 to Future Release

Moving out of the 4.3 milestone while waiting for reporter feedback.

#8 @wonderboymusic
10 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from reviewing to closed

No feedback

Note: See TracTickets for help on using tickets.