Error with Blur Spoiler

This was a lot more complicated than I thought it would be. The issue here is that our spoiler alert plugin replaces images with SVGs so that IE11 can blur them properly, since it doesn’t support CSS blurring. This would cause all sorts of issues with lazy loading because it could be partially loading an image which is suddenly swapped out for a SVG.

The spoiler alert plugin would also replace the SVG frequently which caused even more havoc. Here’s the fix I came up with:

https://github.com/discourse/discourse-spoiler-alert/pull/33

I didn’t merge it right away since it might be somewhat controversial - in IE11 I simply hide the image rather than blurring it. This fixes everything, and means less hacky SVG stuff to carry. The downside is a worse experience for a 5+ year old browser.

Thoughts?

8 Likes