[libxml2] Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag



commit b91111b47599b9b07830db5ae2291739d22c384b
Author: Martin SchrÃder <lionhead onlinehome de>
Date:   Thu May 10 18:52:37 2012 +0800

    Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag
    
    For https://bugzilla.gnome.org/show_bug.cgi?id=642916
    
    I just noticed that the HTML_PARSE_NOIMPLIED flag that you can pass to the
    HTML-Parser methods doesn't do anything. Its intended purpose is to stop the
    HTML-parser from forcibly adding a pair of html/body tags if the stream does
    not contain any.
    
    This is highly useful when you don't need this level of strictness.
    Unfortunately, specifying it doesn't work, because the option is not
    copied into the parsing context.

 HTMLparser.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/HTMLparser.c b/HTMLparser.c
index bf15c6a..d1cbc39 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -6587,6 +6587,10 @@ htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
 	ctxt->options |= HTML_PARSE_IGNORE_ENC;
         options -= HTML_PARSE_IGNORE_ENC;
     }
+    if (options & HTML_PARSE_NOIMPLIED) {
+        ctxt->options |= HTML_PARSE_NOIMPLIED;
+        options -= HTML_PARSE_NOIMPLIED;
+    }
     ctxt->dictNames = 0;
     return (options);
 }



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