[wp-trac] [WordPress Trac] #6331: TinyMCE should have a code button

WordPress Trac noreply at wordpress.org
Mon Mar 24 05:00:07 UTC 2014


#6331: TinyMCE should have a code button
-------------------------+-----------------------
 Reporter:  westi        |       Owner:
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  3.9
Component:  TinyMCE      |     Version:  2.5
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+-----------------------

Comment (by nacin):

 Replying to [comment:26 johnbillion]:
 > Also, should we add the `wp_code` button into the kitchen sink view?

 The only reason why I'd want a code button for the visual editor is inline
 code references (like a function name or something). Part of the problem
 with adding a button is block-level handling. If you can select a block of
 text and click the code button, it can't just wrap <code> as that's
 invalid. So you'd need to wrap it in a pre. But you'd probably only want
 that if what's inside the selection is pure unadulterated plain text.
 Otherwise the pre could do some formatting damage.

 If you mean to select just inline text but end up selecting the entire
 line (and thus the block), you might end up with a pre accidentally. I
 have quirky problems like this all the time when trying to manipulate list
 items in the visual editor.

 I don't think we need another dialog or anything like that. But we do need
 some simple behavior that follows the principle of least astonishment. I'd
 be OK with just doing <code> and ignoring <pre> but that might not be what
 everyone would expect. I mean, would they see a code button and expect we
 support source code? Probably. Maybe we hold off on anything else for 3.9.
 At least there is now a hidden keyboard shortcut.

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


More information about the wp-trac mailing list