jsocol/bleach — pull request #61 by lmorchard (2012-04-12 16:43:41+00:00)
Title: Test to reproduce hang in sanitize_styles

This is not intended as a complete PR, so much as an illustration of the problem and a call for help.

The regex check I commented out in `sanitizer.py` appears to suffer from a hang, when fed the inline styles that appear in the new test.

Of course, the funny thing is that all tests pass with this regex check commented out, so it might not be that important after all? :)

FWIW, as crazy as it looks, this is data "in the wild" from [a page on the MDN wiki](https://developer.mozilla.org/en/SpiderMonkey/Build_Documentation), and it causes the migration process to come to a halt.

I haven't spent too much time dissecting the regex itself, yet. But, I have found that the length of the hang can be reduced by removing some of the styles. I haven't been able to narrow it down to just one style, though. So, that makes me think that it's not an infinite loop per se, but just a very very long process for this given set of inline styles.

However, the hang is so long on my laptop that it never finished for me after letting it go while I wandered off for an hour for lunch. That seems troublesome.