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

WordPress Trac noreply at wordpress.org
Mon Jan 18 18:52:26 UTC 2016


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

Comment (by ericlewis):

 @iseulde and I worked together on attachment:6331.6.diff, a work-in-
 progress. Feedback welcome :)

 A first step here is to add functionality to the existing WP_Code TinyMCE
 command. This command wraps the current selection with a `<code>` element.

 In attachment:6331.6.diff, we add logic to detect whether a single full
 paragraph block is selected, or if the selection spans multiple block
 elements. If so, we wrap it in a `<pre>` tag.

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


More information about the wp-trac mailing list