mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 03:55:04 +03:00
html: Try to avoid passing XML options to HTML parser
This commit is contained in:
parent
76cc63942a
commit
0ce7bfe559
2
SAX2.c
2
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 *))) &&
|
||||
|
11
parser.c
11
parser.c
@ -62,6 +62,7 @@
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/uri.h>
|
||||
#include <libxml/SAX2.h>
|
||||
#include <libxml/HTMLparser.h>
|
||||
#ifdef LIBXML_CATALOG_ENABLED
|
||||
#include <libxml/catalog.h>
|
||||
#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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user