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.
DENVER — Hillary Rodham Clinton summoned the millions of voters who supported her...
Michelle Obama gave the headlining speech tonight at...
***UPDATE 8/26, 6:30 PM*** Following the press conference, the Associated...
In what might be his most controversial attack ad in a campaign dominated by...
Hillary Clinton's job, we were told, was to unite her supporters behind Barack Obama.
My favorite part of Hillary Clinton's speech last night was when she admonished her followers not to...
Democrats are more nervous about Barack Obama's prospects than they were a month...
From the Washington Post's Howard Kurtz: DENVER, Aug. 25 -- Jon Stewart ripped the cable news...
[New Joy Of Sex author Susan] Quilliam, who pronounces the word "sex" with the mildest Liverpudlian...
LOS ANGELES — Dave Freeman, co-author of "100 Things to Do Before You Die,"...
Katie Couric stopped by the Oasis today to film a segment, but took...
The six-word banner above the CNBC logo said it...
NEW YORK (AP) -- Citigroup Inc. isn't just eliminating jobs to slash costs --...
Posted January 17, 2006 | 06:22 PM (EST)