[libxml2] Don't mess with parser options in htmlParseDocument



commit 0a04db19fca3433a0eb7b562d394a0b0695d277d
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Aug 24 14:06:00 2022 +0200

    Don't mess with parser options in htmlParseDocument
    
    Don't set ctxt->html. This member should already be initialized.
    
    Set ctxt->linenumbers in htmlCtxtUseOptions like the XML parser does.

 HTMLparser.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/HTMLparser.c b/HTMLparser.c
index 54f712dc..e48f240a 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -4915,8 +4915,6 @@ htmlParseDocument(htmlParserCtxtPtr ctxt) {
                     "htmlParseDocument: context error\n", NULL, NULL);
        return(XML_ERR_INTERNAL_ERROR);
     }
-    ctxt->html = 1;
-    ctxt->linenumbers = 1;
     GROW;
     /*
      * SAX: beginning of the document processing.
@@ -6876,6 +6874,7 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
         options -= HTML_PARSE_NOIMPLIED;
     }
     ctxt->dictNames = 0;
+    ctxt->linenumbers = 1;
     return (options);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]