# HG changeset patch
# User Nick Wellnhofer <wellnhofer@aevum.de>
# Date 1661342760 -7200
#      Wed Aug 24 14:06:00 2022 +0200
# Node ID b05358bded284dd0edcc3f271586d2c938ed50f0
# Parent  79acc3340cf5372b113b15ccdd89a637a68a0c97
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.

diff --git a/HTMLparser.c b/HTMLparser.c
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -4915,8 +4915,6 @@
 		     "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 @@
         options -= HTML_PARSE_NOIMPLIED;
     }
     ctxt->dictNames = 0;
+    ctxt->linenumbers = 1;
     return (options);
 }