[wp-trac] [WordPress Trac] #44617: Introduce new 'hasBlock' behavior for TinyMCE 'BeforeSetContent' and 'SaveContent' events

WordPress Trac noreply at wordpress.org
Sat Jul 21 13:45:13 UTC 2018


#44617: Introduce new 'hasBlock' behavior for TinyMCE 'BeforeSetContent' and
'SaveContent' events
------------------------------------+---------------------
 Reporter:  danielbachhuber         |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  4.9.8
Component:  Editor                  |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------

Comment (by azaozz):

 Replying to [comment:3 danielbachhuber]:
 > ...If we change the behavior in Gutenberg,

 Hm, may be missing something but we are talking here about changing the
 behaviour in the current/classic editor (not Gutenberg) and possibly
 breaking things, introducing hard to fix edge cases, etc.

 > Also, the problem applies to the single-line Shortcode Block too, not
 just multi-line shortcodes. TinyMCE currently generates this:

 The classic editor has always generated exactly this. There haven't been
 any changes there for at least 5 years :)

 Thunk I wasn't very clear above :) What I'm proposing is to keep doing the
 same things we've been doing since... shortcodes were introduced: run the
 content through the regex that removes extra <p> tags. This is in the
 `shortcodes_unautop()` function. If it needs to be implemented in
 Gutenberg too (although I don't see why), we should "convert" it to js.

 What happens then you run the above example code through
 `shortcodes_unautop()`? :)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44617#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list