Monday, 28 January 2008

Pasting code into Blogger

I've been using a javascript tool to format my example code. It does two useful things:

  1. Replaces html-unfriendly characters such as <>
  2. Wraps it in some nice formatting tags.
You can choose whether it embeds the style information directly into the output or creates a seperate css entry. I've been using the embedding up until recently, but now I have a problem. I've discovered that Blogger's rich text compose mode annihilates my indenting so its time to switch to using the html editor instead. The embedded styles make for noisy html so I will fiddle with this post and try to get the css working instead.
class EvaluateTests < Test::Unit::TestCase
  def test_1
    assert_equal(1, calculate("1"))
  end
end
Edit: Yay, that works fine.

1 comment: