RSS

Naughty Titles and Naughty Comments

Posted January 17, 2006 | 06:22 PM (EST)



stumbleupon :Naughty Titles and Naughty Comments   digg: Naughty Titles and Naughty Comments   reddit: Naughty Titles and Naughty Comments   del.icio.us: Naughty Titles and Naughty Comments

I've added a couple features to my NaughtyWordChars plugin. It now handles comments as well as entries, and I've added some extra clean-up for entry titles (more on that below). You can download the lastest verison of the plugin here.

So, lots of HuffPost bloggers paste their posts titles in from Word files. Every so often, someone pastes in a title with extra space and the begining or end. Even worse, sometimes people paste in titles with line-breaks around them. Since we base our individual archive filenames on the entry title, this causes some ugliness.

For instance, if someone copies something like this:

and pastes it into the title field; something like this comes out the other end:

Which is obviously no good. Even worse, MT generates an different url to use in MTPermalink tags:

After a bunch of digging around, I gave up on a normal pre_save plugin to handle the problem. Seems that (even with a high priority) MT generates the filename for an entry before a pre_save plugin is applied. [Apparently I should have read the docs for MT::Callback a little more carefully. Thanks to Brad for showing me the way.]

What I emerged with a BigPAPI-reliant solution. It sticks some javascript on the page to clean up a post's title before it's submitted. I've been running it for a few days on HuffPost, and it seems to do the trick nicely.

Also, thanks to Joshua Kaufman for the suggestion on comments. The plugin now optionally cleans them too.

Comments for this post are now closed


Categories

Archives

Recent Posts

 

 Site  Web ask.com