parser: Fix crash in xmlParseInNodeContext with HTML documents
Ignore namespaces if we have an HTML document with namespaces added
manually.
Fixes #672.
diff --git a/parser.c b/parser.c
index aeaadcd..b7534ae 100644
--- a/parser.c
+++ b/parser.c
@@ -13251,8 +13251,10 @@
}
xmlAddChild(node, fake);
- if (node->type == XML_ELEMENT_NODE) {
+ if (node->type == XML_ELEMENT_NODE)
nodePush(ctxt, node);
+
+ if ((ctxt->html == 0) && (node->type == XML_ELEMENT_NODE)) {
/*
* initialize the SAX2 namespaces stack
*/