Putting HTML and Other Code into Your Entries without tears

Bookmark and Share
|
One of the downsides to using any of the text editors with Movable Type is that they can be a little too clever.

If you want to post some code samples you have to be very careful or else the engine will interpret and parse the code instead of simply displaying it.

The solution is to use an encoder of some kind to convert the characters into HTML entities that will display in a browser without being parsed.

Arvind pointed me at this old tutorial on the learningmovabletype site which is a good starting point.

It links to this really handy encoding utility that I will be using again and again I would say!

In order to use the encoding you will need to switch from the "Rich Text" editor to either "MarkDown" or "None" and copy and paste in the code you want to display.

The way I've been doing that is to write the entire post leaving markers where I want to put in the code and then going back and doing a simple copy and paste. Switching between the various editors would otherwise be a bit annoying and I'm naturally a bit lazy when it comes to my workflow

  • Currently 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0/5(0 votes cast)
digg| bookmark

Categories

, ,

About this Entry

This page contains a single entry by Michele Neylon published on September 2, 2007 5:01 PM.

Brightening Up Promote This was the previous entry in this blog.

Yet another dashboard widget - Mintier is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.31-en