June 2011 Archives

Syntax highlighting disabled

By default, Movable Type template editing screens load a JavaScript that dynamically adds line numbers and color-coding to the code while editing. This feature uses a third-party script called “CodePress,” which is no longer actively developed and does not work with Safari.

I was forced to disable the CodePress script system-wide because the script has a nasty habit of unexpectedly wiping out the contents of a template upon save. I suspect that this was more likely to happen if code was pasted into the editing area. The contents of templates are all stored in the database, so it would be possible to recover the deleted code from a nightly backup; however, this is an unnecessary inconvenience that site administrators should not have to worry about.

If you relied on the line numbers and syntax highlighting, I would recommend that you cut and paste the code into an external text editor and then paste the code back into Movable Type after editing.