Opened 5 years ago
Last modified 4 years ago
#6331 assigned enhancement
TinyMCE should have a code button
| Reported by: |
|
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)
comment:1
fool4christ — 5 years ago
comment:2
JeremyVisser — 4 years ago
- 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.)
comment:3
JeremyVisser — 4 years ago
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?
comment:4
JeremyVisser — 4 years ago
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.
Hm.. Are you sure TinyMCE doesn't already have a plugin to add the Code button Jeremy?
comment:8
janeforshort — 4 years ago
- 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
comment:10
dd32 — 4 years ago
- 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
comment:12
westi — 4 years ago
- Milestone changed from 2.9 to Future Release
Moving to Future Release until we have a patch for this.

+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.