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.
***SCROLL DOWN FOR VIDEO OF PALIN'S RESIGNATION SPEECH...
When UN Secretary-General Ban Ki Moon meets...
Naked tweeting: the next frontier in staged celebrity...
If it's a rainy weekend and you want to channel that summer feeling, you can rent...
***SCROLL DOWN FOR VIDEO OF PALIN'S RESIGNATION SPEECH...
I'm starting to believe that's a destination; the next step in life once you get...
When Michelle Obama created an organic vegetable garden on...
If President Obama is truly serious about changing the...
Bar Refaeli stars in a new black and white video floating around the internet. Set to music and with...
Missouri State Representative Cynthia Davis is one tough cookie. Last week...
Asked by Meredith Vieira on the "Today Show" if it...
I'm liveblogging the latest Iran election fallout. Email me with any news or thoughts, or follow me...
Fox News' Shepard Smith was having some trouble with a...
The U.S. economy lost 467,000 jobs in June as the...
WASHINGTON — Now it can be told: President Obama says one of the best-kept secrets at the...
WASHINGTON — Mississippi's still king of cellulite,...
CNN's Anderson Cooper reports on a frisky sea lion and the boat it apparently tried...
Posted January 17, 2006 | 06:22 PM (EST)