Ah never saw that before. Thanks for pointing that one out! Technically shouldn't that be encoded as <img src="..." alt=">">? I think you'll find my solution shouldn't fail unless you use data from people determined to make your life miserable.
Comment on Re^3: Regex to "wrap" a <span around an image.