Work around IE7/8 magical DOM node replacement bug

Issue #1194
[doc tests] Fix test runner for IE regexp quirk

Issue #1194