Thank god for script/console

Posted by Tim Connor Fri, 13 Apr 2007 07:08:00 GMT

I got tired of waiting for the weird typo formatting bug that seems to only affect some installs and not others and wanted my code blocks to just look right. Ya, maybe I could have tracked it down, but trunk seems to be under some sort of constant reorganization.

Instead, I just swapped out all the tm:code macros with the html

as = Article.find(:all)
as.each{ |a|
  a.body.gsub! /<typo:code>/, '<pre><code>'
  a.save
}
as.each{ |a|
  a.body.gsub! /<\/typo:code>/, '</code></pre>'
  a.save
}
And now my code formatting is back. At some point maybe I’ll tweak my css, and drop the redundant pre, now that I’m not depending on the macro anymore.