HTML parser rewrite