Opened 5 years ago

Last modified 4 years ago

#6331 assigned enhancement

TinyMCE should have a code button

Reported by: westi Owned by:
Priority: normal Milestone: Future Release
Component: TinyMCE Version: 2.5
Severity: normal Keywords: needs-patch
Cc:

Description

The html editor has a code button on the quicktags bar but TinyMCE doesn't.

This is the only missing feature from TinyMCE that makes me switch to the HTML view when writing my weekly digest posts.

Change History (12)

+1. With WordPress' long importance to the Open Source community, it seems that sharing code on a WordPress-powered site ought to be trivially easy.

There definitely needs to be a patch for this.

  • Milestone changed from 2.9 to 2.8
  • Owner changed from anonymous to JeremyVisser

+1. This should be trivial to add. (I'll see how I go today.)

Okay, I am about to have a nervous breakdown from TinyMCE hacking. Getting absolutely nowhere, and now my right eyelid is twitching. Anybody else want to have a stab at this?

I'm getting somewhere. I've got a working button to wrap <code> tags around selected text. No icon yet, and if you click the button a second time, it does not remove the code tag.

I think it is because I am using execCommand('mceReplaceContent'), where something that is aware of nodes would be more appropriate.

comment:5   DD324 years ago

Hm.. Are you sure TinyMCE doesn't already have a plugin to add the Code button Jeremy?

comment:6   ryan4 years ago

  • Type changed from defect (bug) to enhancement

Totally, at the moment I'm just putting code in my posts in italic.

  • Milestone changed from 2.8 to Future Release

Punting to be evaluated in next development cycle due to time constraints.

  • Milestone changed from Future Release to 2.8.1
  • Owner changed from JeremyVisser to Denis-de-Bernardy
  • Status changed from new to accepted
  • Milestone changed from 2.8.1 to 2.9

Enhancements, no matter how seemingly trivial, should not be in a point release

  • Owner Denis-de-Bernardy deleted
  • Status changed from accepted to assigned
  • Milestone changed from 2.9 to Future Release

Moving to Future Release until we have a patch for this.

Note: See TracTickets for help on using tickets.