[wp-testers] HTML "code" tag in the Visual Editor?

Andrew Ozz admin at laptoptips.ca
Sun May 4 19:57:26 GMT 2008


Peter Westwood wrote:
> Rick Beckman wrote:
> | Is there an easy way to insert CODE blocks using the visual editor? I 
> love
> | that writing code into the editor itself auto-escapes everything, but
> I have
> | to keep switching back and forth between it and the text editor to add 
> the
> | actual CODE tags, and I inevitably write a lot of code into it, which 
> gets
> | eaten upon returning to the Visual Editor. Very frustrating.
> |
> | I tried using an advanced TinyMCE plugin, which has let me add a lot
> of tags
> | to its toolbars that have come in handy, but even it neglects to
> include the
> | CODE button.
> |
> | Is there some sort of CODE-stigma I'm unaware of?
> |
> 
> Nope.  It annoys me too.
> 
> http://trac.wordpress.org/ticket/6331
> 
> Someone fancy cooking up a patch ;-)

The <code> tag is an inline text tag, much like <em> and <strong>. All 
it does in most browsers is to render the text with monospace font.

I think you need the <pre> tag. It's the only html tag preserving line 
breaks and spaces and both TinyMCE and wpautop understand it (in TinyMCE 
it can be selected under the "Format" drop-down on the second row).
http://trac.wordpress.org/ticket/6610


More information about the wp-testers mailing list