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: |
|
Owned by: |
|
---|---|---|---|
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)
#3
@
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
@
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
Moving to 4.3 for review.