While this blog uses WordPress, at work I still have a few sites built using Movable Type. One of those sites is an events calendar, and I had been working on a iCAL template so that I could easily import the events into other calendars. Getting the file to work with “iCalShare”:http://www.icalshare.com/ was pretty easy, but one of the older systems at work was a bit fussy. It didn’t like any of the special characters, like accented vowels or curly quotes that invariably crept into the event descriptions.
I spent quite a while looking for a way to remove all of these characters, but all the existing plugins and filters seemed to leave some of them behind. I spent some time thinking about using Brad Choate’s “Regex plugin”:http://www.sixapart.com/pronet/plugins/plugin/regex.html, but after double-checking “Movable Type’s Global tag attribute filters”:http://www.sixapart.com/movabletype/docs/3.2/b_global_filters/ I found what I was looking for. Sort of.
bq. _dirify_ also converts certain high-ASCII characters (accented characters, etc) to low-ASCII characters, meaning that something like crudité will be converted to crudite. For example, if the value of the tag without this attribute were Foo “Baz” is< br /> Bar!, the dirified version would be foo_baz_is_bar.
Yes — that’s what I wanted, but without the underscores, and usable for much longer blocks of text.
Fortunately “Adam Kalsey”:http://kalsey.com/blog/ and “Crys Clouse”:http://www.sixapart.com/pronet/plugins/plugin/dirifyplus.html had written code to improve the dirify feature, and using that as a starting point I made the changes to create the new global filter I needed. Something that would convert the high-ASCII characters down to low-ASCII, and strip out all the extra characters and line-breaks I didn’t need.
Lowdown.pl
_Version 1.0_
Lowdown removes extra information to displays plain text in Movable Type. It converts certain high-ASCII characters (accented characters, etc) to low-ASCII characters, strips HTML tags, and changes line breaks to spaces.
Installation: save Lowdown.txt as Lowdown.pl and upload it to your Movable Type ‘plugins’ directory
Usage Example: < $MTEntryBody lowdown="1"$>
This can be helpful when generating some types of feeds (eg. iCAL, RSS). If anyone is interested, I could also post the iCAL template for Movable Type that I developed that uses the Lowdown plugin.
Update
You can now get the lowdown directly from Six Apart’s Plugin Directory.
Install X-Ray Extension for Firefox