[wp-hackers] Code Tag Driving me Nuts!!

Computer Guru computerguru at neosmart.net
Sat Oct 28 19:40:39 GMT 2006


Is the <code></code> tag supposed to (in WP) display whatever is in between
it tit-for-tat or is it supposed to parse the HTML within?

It's driving me _nuts_!
I'm trying to put up a post that has more code than normal text, and I just
can't for the life of me figure out how to get my stuff to display right!
If I put un-encoded HTML straight into the <code> tags, it'll display OK in
WP, but it'll completely screw up my other apps that use the WP database.

http://neosmart.ath.cx/codesample.html

That's how normal HTML is treated: you put _encoded_ html in the <Code> tags
just as you would anywhere else' and it get's parsed.

With WP if you put encoded HTML it displays as-is; as if a <pre> tag was
applied to the box _which isn't right_.

It seems near impossible to get code to work right... why is it built this
way? I can't see any benefit to using "pre" tags for code boxes unless
explicitly specified.

I thought this plugin
(http://www.coffee2code.com/archives/2005/03/29/plugin-preserve-code-formatt
ing/) would help, but it didn't; and the codex on this topic is absolutely
of no use: http://codex.wordpress.org/Writing_Code_in_Your_Posts

Owen Winkler's "Code Filter" plugin might be what I'm looking for - but it's
gone now with the rest of his data after the server crash a couple of months
ago.


Everything I read says: "Escape your HTML in code tags in WP"
Yet when I do that it displays them as-is... driving me nuts.

Please someone explain this nightmare!

(WP 2.1)

Computer Guru
NeoSmart Technologies
http://neosmart.net/blog/




More information about the wp-hackers mailing list