New MT plugin author

Some guy named Sam Ruby, who doesn’t seem to have ever done any Movable Type plugin writing before, has done a new version of Gavin Estey’s wonderful SafeHref plugin, which now covers every possible place a URI might appear. I think I’ll comment out a few of them, since I don’t find much need for framesets or <base href=””> in a weblog post, but expanding SafeHref to cover me when I forget to &amp; an & in an image or form URI sounds like a good thing.

13 Comments

Comment by Neil T. #
2004-04-02 00:24:59

Sam Ruby is the guy who hosts the Atom wiki and was very instrumental in getting the format and API to where it is today. He also co-wrote the Feed Validator with Mark Pilgrim. So he’s more than just ”some guy” :).

 
Comment by Pete Prodoehl #
2004-04-02 03:37:51

Humor is lost on some…

 
Comment by Sam Ruby #
2004-04-02 04:22:52

There was a stray print statement on line 80 in the original version I posted. ”Some guy” named Jacques Distler brought this to my attention. ;-)

Just to be clear on what I did: I took a list that Mark Pilgrim posted, and converted it to a hash of hashes. And then I modified exactly two lines in the original: the one that looked specifically for ”a” and the one that looked for ”href”.

 
Comment by Phil Ringnalda #
2004-04-02 07:29:50

We’ll take what we can get: there are a ton of things that could easily be done in MT plugins (or in the core) that either nobody has thought to do, or bothered to code. My last trivial thrown-together one intended for one person with a particular setup has been nearly as popular as any I’ve done, that seemed much more interesting.

”Jacques”? Sounds like he might be French, you better check his advice carefully.

And yes, I’m afraid I’m cursed with a sense that I confuse with humor. I’m not quite sure what it actually is.

 
Comment by Gavin #
2004-04-02 10:40:46

I’ve updated it so you can write:

<$MTEntryBody safe_urls=”a href img src form action”$>

Get it from: http://www.estey.com/mt/admin.cgi?SafeHref

 
Comment by Scott Johnson #
2004-04-02 14:38:46

This one should definitely be useful. I have the hardest time keeping my ampersands escaped properly when I’m posting to MT sites. Thanks for your work, Sam. And thanks for the pointer to the new plugin, Phil.

 
Comment by Matt #
2004-04-04 21:44:46

It’s nice that this can be a plugin, but if a tool has a commitment to standards it should be automatic.

Comment by Phil Ringnalda #
2004-04-04 22:08:06

That just might be the reason I was posting about it ;)

(Along with the fact that I didn’t give it nearly enough credit when I first mentioned it, since I completely rely on it.)

What I actually want is a tool that refuses to let me save a post (or anyone save a comment) that will result in invalid HTML or RSS. But the last time I tried to install a local copy of the HTML validator, it didn’t go well. Maybe once I switch to a dedicated server, or get PHP 5 with Tidy built in (which is likely to happen a year or two sooner if I switch to a dedicated server).

Comment by Jacques Distler #
2004-04-04 23:01:02

Well, Phil, since your templates are generating ill-formed *ML (I’m told ”ill-formed XML” is an oxymoron.), you can’t just push the problem onto your commenters.

Comment by Phil Ringnalda #
2004-04-04 23:33:08

My templates? Surely you mean the code of which I am only a user? My ”I’m too lazy to upgrade right now” PGP plugin was generating links with unencoded ampersands, I fixed that; my ”whose idea was this list of block-level elements? oops!” convert breaks filter was double-wrapping paragraphs that people were nice enough to mark up on their own, I fixed that; somebody, I say somebody, slapped some not-so-smart-quotes into a comment, the browser and OS manufacturers really need to fix that, or failing them the blogware manufacturers, because although I’ll validate my front page every time I add an entry, I’ll be damned if I’ll validate each entry page every time someone comments, and might have copied and pasted.

Installing the HTML validator may be (relatively) easy if you’ve got root, but on a shared host, or for someone who stretched their techieness to the limit just to install MT, it’s just not an option. The feed validator, though, is dead-simple to install and cat-quick to run, and it’s my own lazy fault that I haven’t hacked in validation of my comment feed when a comment is saved, with an email to tell me when it’s horked.

Comment by Jacques Distler #
2004-04-04 23:57:17

My templates? Surely you mean the code of which I am only a user? My ”I’m too lazy to upgrade right now” PGP plugin was generating links with unencoded ampersands, I fixed that; my ”whose idea was this list of block-level elements? oops!” convert breaks filter was double-wrapping paragraphs that people were nice enough to mark up on their own, I fixed that;

Sorry, I didn’t mean you personally. I meant ”not the commenter.” Whether the culprit is you, or me, or Ben Trott, or Krishnan Srijith, it’s not the commenter.

somebody, I say somebody, slapped some not-so-smart-quotes into a comment, the browser and OS manufacturers really need to fix that, or failing them the blogware manufacturers…

Try this.

Installing the HTML validator may be (relatively) easy if you’ve got root, but on a shared host, or for someone who stretched their techieness to the limit just to install MT, it’s just not an option.

I’m of the opinion that blogging software authors should be providing validation, not poor benighted end-users. But that’s probably just wishful thinking on my part.

 
 
 
Comment by Sam Ruby #
2004-04-05 01:34:25

I validate my XHTML not with the W3C validator, but by using a validating XHTML parser (libxml2) with a locally cached set of XHTML DTDs.

Comment by Phil Ringnalda #
2004-04-05 08:26:52

Bloody Python ;)

The aforementioned PHP 5, however, does embed libxml2… It really does look very nice, even if it did force me to throw Apache 2 off my laptop (PHP 4.x + Apache 2 in a production Linux server may not be a good thing, but PHP 4.x + Apache 2 on a Windows laptop worked quite nicely).

 
 
 
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.