Updated autop

Most of the scripts I offer on this site are things I’ve written myself, for myself. As part of this living site they are constantly updated and tweaked, yet sometimes I don’t update the scripts section with what’s running live here, usually because I tell myself that the code is so ugly that no one would ever want to use it. Well . . . it works. I’ve decided to put the updated autop code up for all to use. Impetus for the change came almost two months ago from Phil Ringnalda, though my implementation is pretty different from the one he suggested in his post.

Basically what the update does is make the paragraph code ‘smarter’ to deal with lines that end with block-level tags, therefore not creating extra spaces and invalidating your HTML. Try it out! I’ve left the simpler version there for people (like me in some applications) that don’t need the extra code at all.

SHARE YOUR THOUGHTS