`(\'?)([^\']*)\3` works, too. I took the regex replacement from develop-olympus.

An opening quote but no closing quote will cause a syntax error in the cached HTML files IIRC. I'm not sure if it makes much sense to look at that in tests. I'll try to test that a little bit more.