diff --git a/SAX2.c b/SAX2.c index a0de8f86..0d387da4 100644 --- a/SAX2.c +++ b/SAX2.c @@ -1773,7 +1773,7 @@ xmlSAX2TextNode(xmlParserCtxtPtr ctxt, const xmlChar *str, int len) { * intern the formatting blanks found between tags, or the * very short strings */ - if (ctxt->dictNames) { + if ((!ctxt->html) && (ctxt->dictNames)) { xmlChar cur = str[len]; if ((len < (int) (2 * sizeof(void *))) && diff --git a/parser.c b/parser.c index 964d64d5..222410f2 100644 --- a/parser.c +++ b/parser.c @@ -62,6 +62,7 @@ #include #include #include +#include #ifdef LIBXML_CATALOG_ENABLED #include #endif @@ -13599,6 +13600,11 @@ xmlCtxtSetOptionsInternal(xmlParserCtxtPtr ctxt, int options, int keepMask) int xmlCtxtSetOptions(xmlParserCtxtPtr ctxt, int options) { +#ifdef LIBXML_HTML_ENABLED + if ((ctxt != NULL) && (ctxt->html)) + return(htmlCtxtSetOptions(ctxt, options)); +#endif + return(xmlCtxtSetOptionsInternal(ctxt, options, 0)); } @@ -13651,6 +13657,11 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options) { int keepMask; +#ifdef LIBXML_HTML_ENABLED + if ((ctxt != NULL) && (ctxt->html)) + return(htmlCtxtUseOptions(ctxt, options)); +#endif + /* * For historic reasons, some options can only be enabled. */