Fix #405 - compatibility with html5lib 1.0