WordLog

A weblog authored by Carthik about the latest in the WordPress world.

Sunday, May 13, 2007

Displaying HTML Source Code in Your Blog Posts

Filed under: — Carthik @ 2:16 pm

I badly wanted to display the following html code in a blog post that I am drafting:
“<link rel=’archives’ title=’May 2007′ href=’http://wordlog.com/archives/2007/05/’ />”

I tried putting the raw line of html between “code” tags and then even “pre” tags, but it just wouldn’t show up. Turns out you need to encode the html entities, like the “<” by replacing them with their html code equivalents – & lt ; is the equivalent for the left angle bracket.

There is a cute little encoder tool at wordpress.org written by The matt – however it seems to not want to work anymore. So I found a replacement Encode/Decode HTML entities tool at centricle.com. It works, as evidenced by the code displayed in this blog entry.

 

Powered by WordPress

eXTReMe Tracker