HTMLparser.c


Log

Author Commit Date CI Message
Nick Wellnhofer 438e595a 2020-08-09T14:43:53 Stop counting nbChars in parser context The value was inaccurate and never used.
Nick Wellnhofer f6a9541f 2020-08-09T14:29:35 Remove unneeded progress checks in HTML parser The HTML parser should now be guaranteed to make progress, so the checks became unnecessary.
Nick Wellnhofer 93ce33c2 2020-07-23T17:34:08 Fix several quadratic runtime issues in HTML push parser Fix a few remaining cases where the HTML push parser would scan more content during lookahead than being parsed later. Make sure that htmlParseDocTypeDecl consumes all content up to the final '>' in case of errors. The old comment said "We shouldn't try to resynchronize", but ignoring invalid content is also what the HTML5 spec mandates. Likewise, make htmlParseEndTag skip to the final '>' in invalid end tags even if not in recovery mode. This is probably the most visible change in practice and leads to different output for some tests but is also more in line with HTML5. Make sure that htmlParsePI and htmlParseComment don't abort if invalid characters are encountered but log an error and ignore the character. Change some other end-of-buffer checks to test for a zero byte instead of relying on IS_CHAR. Fix usage of IS_CHAR macro in htmlParseScript.
Nick Wellnhofer 173a0830 2020-07-22T23:15:35 Fix quadratic runtime when push parsing HTML start tags Make sure that htmlParseStartTag doesn't terminate on characters for which IS_CHAR_CH is false like control chars. In htmlParseTryOrFinish, only switch to START_TAG if the next character starts a valid name. Otherwise, htmlParseStartTag might return without consuming all characters up to the final '>'. Found by OSS-Fuzz.
Nick Wellnhofer 6995eed0 2020-07-19T13:54:52 Fix quadratic runtime when push parsing HTML entity refs The HTML push parser would look ahead for characters in "; >/" to terminate an entity reference but actual parsing could stop earlier, potentially resulting in quadratic runtime. Parse char data and references alternately in htmlParseTryOrFinish and only look ahead once for a terminating '<' character. Found by OSS-Fuzz.
Nick Wellnhofer 8e219b15 2020-07-12T21:43:44 Fix HTML push parser lookahead The parsing rules when looking for terminating chars or sequences in the push parser differed from the actual parsing code. This could result in the lookahead to overshoot and data being rescanned, potentially leading to quadratic runtime. Comments must never be handled during lookahead. Attribute values must only be skipped for start tags and doctype declarations, not for end tags, comments, PIs and script content.
Nick Wellnhofer e050062c 2020-07-15T14:38:55 Make htmlCurrentChar always translate U+0000 The general assumption is that htmlCurrentChar only returns 0 if the end of the input buffer is reached. The UTF-8 path already logged an error if a zero byte U+0000 was found and returned a space character instead. Make the ASCII code path do the same. htmlParseTryOrFinish skips zero bytes at the beginning of a buffer, so even if 0 was returned from htmlCurrentChar, the push parser would make progress. But rescanning the input could cause performance problems. The pull parser would abort parsing and now handles zero bytes in ASCII mode the same way as the push parser or as in UTF-8 mode. It would be better to return the replacement character U+FFFD instead, but some of the client code assumes that the UTF-8 length of input and output matches.
Nick Wellnhofer dfd4e330 2020-07-15T14:22:08 Rework control flow in htmlCurrentChar Don't call xmlCurrentChar after switching encodings. Rearrange code blocks and fall through to normal UTF-8 handling.
Nick Wellnhofer 1493130e 2020-07-15T12:54:25 Fix UTF-8 decoder in HTML parser Reject sequences starting with a continuation byte as well as overlong sequences like the XML parser. Also fixes an infinite loop in connection with previous commit 50078922 since htmlCurrentChar would return 0 even if not at the end of the buffer. Found by OSS-Fuzz.
Nick Wellnhofer 50078922 2020-07-12T20:28:47 Fix quadratic runtime when parsing HTML script content If htmlParseScript returns upon hitting an invalid character, htmlParseLookupSequence will be called again with checkIndex reset to zero, potentially resulting in quadratic runtime. Make sure that htmlParseScript consumes all input in one go and simply skips over invalid characters similar to htmlParseCharDataInternal. Found by OSS-Fuzz.
Nick Wellnhofer 3f18e748 2020-07-11T14:34:57 Reset HTML parser input before reporting error Avoid use-after-free, similar to 13ba5b61. Also make sure that xmlBufSetInputBaseCur sets valid pointers in case of buffer errors. Found by OSS-Fuzz.
Nick Wellnhofer 3da8d947 2020-07-09T16:08:38 Fix more quadratic runtime issues in HTML push parser Make sure that checkIndex is set when returning without match from inside a comment. Also track parser state in htmlParseLookupChars. Found by OSS-Fuzz.
Nick Wellnhofer 741b0d0a 2020-07-07T12:54:34 Fix regression introduced with 477c7f6a The 'inSubset' member is actually used by the SAX2 handlers. Store extra parser state in 'hasPErefs'.
Nick Wellnhofer 477c7f6a 2020-06-28T15:54:23 Fix quadratic runtime in HTML parser Commit eeb99329 removed an important optimization avoiding quadratic runtime when repeatedly scanning the input buffer for terminating characters in the HTML push parser. The related bug is https://bugzilla.gnome.org/show_bug.cgi?id=444994 Make sure that ctxt->checkIndex is always written and store additional parser state in ctxt->inSubset which is unused in the HTML parser. Found by OSS-Fuzz.
Nick Wellnhofer 13ba5b61 2020-06-28T13:16:46 Reset HTML parser input before reporting encoding error If charset conversion fails, reset the input pointers before reporting the error and bailing out. Otherwise, the input pointers are left in an invalid state which could lead to use-after-free and other memory errors. Similar to f9e7997e. Found by OSS-Fuzz.
Nick Wellnhofer 681f094e 2020-06-15T15:23:05 Fix unsigned integer overflow in htmlParseTryOrFinish Cast to signed type before subtraction to avoid unsigned integer overflow. Also use ptrdiff_t to avoid potential integer truncation. Found with libFuzzer and UBSan.
Nick Wellnhofer 31ca4a72 2020-06-15T18:47:53 Fix integer overflow in htmlParseCharRef Fixes #115.
Nick Wellnhofer 20c60886 2020-03-08T17:19:42 Fix typos Resolves #133.
Nick Wellnhofer f9f8df0a 2019-10-03T04:15:52 Fix uninitialized memory access in HTML parser The SAX2 character handler expects NULL-terminated buffer. Closes #106. Also see https://github.com/lxml/lxml/pull/288
Jared Yanovich 2a350ee9 2019-09-30T17:04:54 Large batch of typo fixes Closes #109.
Nick Wellnhofer dbc6b55b 2019-05-16T21:06:56 Fix warnings when compiling without reader or push parser
Nick Wellnhofer 60173c82 2018-09-11T14:08:39 Reset HTML parser input pointers on encoding failure Call xmlBufResetInput before bailing out if switching the encoding fails. Otherwise, the input pointers could be left in an invalid state. Similar to commit f9e7997e803457b714352c4d51a96104ae298d94 for the XML parser. Thanks to Yunho Kim for the report. Closes: #27
Daniel Veillard 35e83488 2018-04-18T15:58:42 HTML noscript should not close p For https://bugzilla.gnome.org/show_bug.cgi?id=795343 - HTMLparser.c: noscript should not close <p> but it should close <script>
Nick Wellnhofer 7a1bd7f6 2018-03-17T00:03:24 Revert "Change calls to xmlCharEncInput to set flush false" This reverts commit 6e6ae5daa6cd9640c9a83c1070896273e9b30d14 which broke decoding of larger documents with ICU. See https://bugs.chromium.org/p/chromium/issues/detail?id=820163
Joel Hockey 6e6ae5da 2018-01-02T21:47:35 Change calls to xmlCharEncInput to set flush false when not final call. Having flush incorrectly set to true causes errors for ICU.
Nick Wellnhofer cb5541c9 2017-11-13T17:08:38 Fix libz and liblzma detection If libz or liblzma are detected with pkg-config, AC_CHECK_HEADERS must not be run because the correct CPPFLAGS aren't set. It is actually not required have separate checks for LIBXML_ZLIB_ENABLED and HAVE_ZLIB_H. Only check for LIBXML_ZLIB_ENABLED and remove HAVE_ZLIB_H macro. Fixes bug 764657, bug 787041.
Nick Wellnhofer e03f0a19 2017-11-09T16:42:47 Fix hash callback signatures Make sure that all parameters and return values of hash callback functions exactly match the callback function type. This is required to pass clang's Control Flow Integrity checks and to allow compilation to asm.js with Emscripten. Fixes bug 784861.
Nick Wellnhofer 576912fa 2017-06-17T15:59:13 Make HTML parser functions take const pointers The 'cur' parameter of htmlParseDoc and htmlSAXParseDoc should be 'const xmlChar *'. Fixes bug 770650.
Nick Wellnhofer 0b2d5c48 2017-06-12T19:10:04 Initialize keepBlanks in HTML parser This caused failures in the HTML push tests but the fix required to change the expected output of the HTML SAX tests.
Nick Wellnhofer 9a366a37 2017-06-11T12:40:01 Fix compiler warning in htmlParseElementInternal
Nick Wellnhofer f39e3be0 2017-06-11T12:35:59 Fix sanity check in htmlParseNameComplex - (cur - len) can overflow. - Throw an internal error. Fixes bug 780077.
Pranjal Jumde 11ed4a7a 2016-03-02T15:52:24 Heap use-after-free in htmlParsePubidLiteral and htmlParseSystemiteral For https://bugzilla.gnome.org/show_bug.cgi?id=760263 * HTMLparser.c: Add BASE_PTR convenience macro. (htmlParseSystemLiteral): Store length and start position instead of a pointer while iterating through the public identifier since the underlying buffer may change, resulting in a stale pointer being used. (htmlParsePubidLiteral): Ditto.
David Kilzer 4472c3a5 2016-05-13T15:13:17 Fix some format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 Decorate every method in libxml2 with the appropriate LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups following the reports.
Hugh Davenport beca86e8 2016-05-04T11:23:49 Detect change of encoding when parsing HTML names From https://bugzilla.gnome.org/show_bug.cgi?id=758518 Happens when a file has a name getting parsed, but no valid encoding set, so libxml has to guess what the encoding is. This patch detects when the buffer location changes, and if it does, restarts the parsing of the name. This slightly change a couple of regression tests output
Pranjal Jumde a820dbea 2016-03-01T11:34:04 Bug 758605: Heap-based buffer overread in xmlDictAddString <https://bugzilla.gnome.org/show_bug.cgi?id=758605> Reviewed by David Kilzer. * HTMLparser.c: (htmlParseName): Add bounds check. (htmlParseNameComplex): Ditto. * result/HTML/758605.html: Added. * result/HTML/758605.html.err: Added. * result/HTML/758605.html.sax: Added. * runtest.c: (pushParseTest): The input for the new test case was so small (4 bytes) that htmlParseChunk() was never called after htmlCreatePushParserCtxt(), thereby creating a false positive test failure. Fixed by using a do-while loop so we always call htmlParseChunk() at least once. * test/HTML/758605.html: Added.
Jan Pokorný bb654feb 2016-04-13T16:56:07 Fix typos: dictio{ nn -> n }ar{y,ies} Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Hugh Davenport 8fb4a770 2015-11-20T17:16:06 CVE-2015-8242 Buffer overead with HTML parser in push mode For https://bugzilla.gnome.org/show_bug.cgi?id=756372 Error in the code pointing to the codepoint in the stack for the current char value instead of the pointer in the input that the SAX callback expects Reported and fixed by Hugh Davenport
Daniel Veillard e724879d 2015-10-30T21:14:55 Fix parsing short unclosed comment uninitialized access For https://bugzilla.gnome.org/show_bug.cgi?id=746048 The HTML parser was too optimistic when processing comments and didn't check for the end of the stream on the first 2 characters
Daniel Veillard 140c251e 2015-06-30T11:36:28 Recover unescaped less-than character in HTML recovery parsing As pointed by Christian Schoenebeck <schoenebeck@crudebyte.com> on the list and based on some of his early patches, this preserve content when unescaped opening angle brackets are not escaped in textual content like: <p> a < b </p> <p> a <0 </p> <p> a <=0 </p> while still reporting the error.
Daniel Veillard 292a9f29 2014-10-06T18:51:04 Possible overflow in HTMLParser.c For https://bugzilla.gnome.org/show_bug.cgi?id=720615 make sure that the encoding string passed is of reasonable size
Philip Withnall 579ebbcb 2014-06-20T21:03:42 HTMLparser: Correctly initialise a stack allocated structure If not initialised, the ‘node’ member remains undefined. Coverity issue: #60466 https://bugzilla.gnome.org/show_bug.cgi?id=731990
Gaurav 3e0eec43 2014-06-13T14:45:20 Adding some missing NULL checks in SAX2 DOM building code and in the HTML parser
Daniel Veillard b0c7e7e5 2014-02-06T10:50:35 Fix an typo 'onrest' in htmlScriptAttributes As pointed out by "Laurent <guitarneck@free.fr>"
Daniel Veillard 4e1476c5 2013-12-09T15:23:40 adding init calls to xml and html Read parsing entry points As pointed out by "Tassyns, Bram <BramT@enfocus.com>" on the list some call had it other didn't, clean it up and add to all missing ones
Arnold Hendriks 826bc320 2013-11-29T14:12:12 Fix HTML push parser to accept HTML_PARSE_NODEFDTD For https://bugzilla.gnome.org/show_bug.cgi?id=719515 fixes htmlParseTryOrFinish to interpret HTML_PARSE_NODEFDTD, and updates xmllint to actually pass --nodefdtd to the push version of the HTML parser
Daniel Veillard bf058dce 2013-02-13T18:19:42 Fix the flushing out of raw buffers on encoding conversions https://bugzilla.gnome.org/show_bug.cgi?id=692915 the new set of converting functions tried to limit the encoding conversion of the raw buffer to the consumption one to work in a more progressive fashion. Unfortunately this was bad for performances and led to errors on progressive parsing when a very large chunk was close to the end of the document. Fix the new internal function and switch back to the old way of converting. Fix another bug in the process.
Daniel Veillard de0cc20c 2013-02-12T16:55:34 Fix some buffer conversion issues https://bugzilla.gnome.org/show_bug.cgi?id=690202 Buffer overflow errors originating from xmlBufGetInputBase in 2.9.0 The pointers from the context input were not properly reset after that call which can do reallocations.
Daniel Veillard f8e3db04 2012-09-11T13:26:36 Big space and tab cleanup Remove all space before tabs and space and tabs at end of lines.
Daniel Veillard f933c898 2012-09-07T19:32:12 Keep non-significant blanks node in HTML parser For https://bugzilla.gnome.org/show_bug.cgi?id=681822 Regardless if the option HTML_PARSE_NOBLANKS is set or not, blank nodes are removed from a HTML document, for example: <html> <head> <title>This is a test.</title> </head> <body> <p>This is a test.</p> </body> </html> is read as: <html><head><title>This is a test.</title></head><body> <p>This is a test.</p> </body></html> This changes the default behaviour but the old behaviour is available as expected when using the parser flag HTML_PARSE_NOBLANKS Based on original patch from Igor Ignatyuk <igor_ignatiouk@hotmail.com> * HTMLparser.c: change various places in the parser where ignorable_space SAX callback was called without checking for the parser flag preference * xmllint.c: make sure we use the new flag even for HTML parsing * result/HTML/*: this modifies the output of a number of tests
Conrad Irwin b60061a7 2012-07-27T15:42:27 Visible HTML elements close the head tag In HTML email it's common to find arbitrary fragments of HTML, the one that triggered this change was of the form: <meta><font></font><div>... Before this change the <font> tag was part of the implicit <head> that gets created for the <meta> tag, after this change, it is part of the <body>, which more closely matches the behaviour of modern HTML implementations.
Daniel Veillard 00ac0d3b 2012-07-16T18:03:01 More cleanups for input/buffers code When calling xmlParserInputBufferPush, the buffer may be reallocated and at the input level the pointers for base, cur and end need to be reevaluated. * buf.c buf.h: add two new functions, one to get the base from the input of the buffer, and another one to reset the pointers based on the cur and base inded * HTMLparser.c parser.c: cleanup to use the new helper functions as well as making sure size_t is used for the indexes computations
Daniel Veillard 61551a1e 2012-07-16T16:28:47 Cleanup function xmlBufResetInput() to set input from Buffer This was scattered in a number of modules, xmlParserInputPtr have usually their base, cur and end pointer set from an xmlBuf used as input. * buf.c buf.h: add a new function implementing this setup * parser.c HTMLparser.c catalog.c parserInternals.c xmlreader.c use the new function instead of digging into the buffer in all those modules
Daniel Veillard a78d8036 2012-07-16T14:56:50 Convert of the HTML parser to new input buffers Changes similar to the ones done in the XML parser for the routines which are not shared.
Denis Pauk a0cd075d 2012-05-11T19:31:12 HTML parser error with <noscript> in the <head> For https://bugzilla.gnome.org/show_bug.cgi?id=615785 When the <noscript> is found, <head> is closed and a <body> element is created. The real <body id="xxx"> gets skipped over, so I can't see any of the body's attributes. Just don't close <head> when encountering a <noscript> Add a regression test too
Denis Pauk fdf990c2 2012-05-10T20:40:49 Allow to parse 1 byte HTML files For https://bugzilla.gnome.org/show_bug.cgi?id=605740 File 1 byte long were not accepted by the HTML push parser
Martin Schröder b91111b4 2012-05-10T18:52:37 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.
Lin Yi-Li 24464be6 2012-05-10T16:14:55 Avoid memory leak if xmlParserInputBufferCreateIO fails For https://bugzilla.gnome.org/show_bug.cgi?id=643949 In case of error on an IO creation input the given context is terminated with the given close function, except if the error happened in xmlParserInputBufferCreateIO. This can lead to a resource leak which is fixed by this patch.
Denis Pauk 868d92da 2012-05-10T15:34:57 Add HTML parser support for HTML5 meta charset encoding declaration For https://bugzilla.gnome.org/show_bug.cgi?id=655218 http://www.w3.org/TR/2011/WD-html5-20110525/semantics.html#the-meta-element """ The charset attribute specifies the character encoding used by the document. This is a character encoding declaration. If the attribute is present in an XML document, its value must be an ASCII case-insensitive match for the string "UTF-8" (and the document is therefore forced to use UTF-8 as its encoding). """ However, while <meta http-equiv="Content-Type" content="text/html; charset=utf8"> works, <meta charset="utf8"> does not. While libxml2 HTML parser is not tuned for HTML5, this is a simple addition Also added a testcase
Pavel Andrejs 8ad4da5f 2012-05-08T11:01:12 HTML element position is not detected propperly The data in node_seq in xmlParserCtxt was not updated properly when parsing HTML. This patch fixes the accounting for both pull and push mode of HTML parsing.
Daniel Veillard c62efc84 2011-05-16T16:03:50 Add options to ignore the internal encoding For both XML and HTML, the document can provide an encoding either in XMLDecl in XML, or as a meta element in HTML head. This adds options to ignore those encodings if the encoding is known in advace for example if the content had been converted before being passed to the parser. * parser.c include/libxml/parser.h: add XML_PARSE_IGNORE_ENC option for XML parsing * include/libxml/HTMLparser.h HTMLparser.c: adds the HTML_PARSE_IGNORE_ENC for HTML parsing * HTMLtree.c: fix the handling of saving when an unknown encoding is defined in meta document header * xmllint.c: add a --noenc option to activate the new parser options
Denis Pauk 91d239c5 2010-11-04T12:39:18 617468 fix progressive HTML parsing with style using "'" Style and script can contain ',"". This patch fixes call htmlParseLookupSequence with set flag 'ignoreattrval' to ignore this char
Pierre Belzile d4b54471 2010-11-04T10:18:17 614005 Possible erroneous HTML parsing on unterminated script Fix a nasty error handling problem when an error happen at the end of the input buffer.
Daniel Veillard 8ad2930f 2010-10-28T11:51:22 make sure htmlCtxtReset do reset the disableSAX field As pointed out by Stefan Behnel <stefan_ml@behnel.de>
Michael Day af58ee13 2010-08-02T13:43:28 Fix a couple of typo in HTML parser error messages
Daniel Veillard f1121c48 2010-07-26T14:02:42 Add an HTML parser option to avoid a default doctype - include/libxml/HTMLparser.h: defines the new HTML parser option HTML_PARSE_NODEFDTD - HTMLparser.c: if option is set don't add a default DTD - xmllint.c: add the corresponding --nodefdtd option in xmllint
Daniel Veillard 06c93b75 2010-03-15T16:08:44 Remove a few warnings
Daniel Veillard 3c080d6d 2010-03-15T15:47:50 Don't give default HTML boolean attribute values in parser * HTMLparser.c: don't default value of HTML boolean attributes in the parser * SAX2.c: move this to SAX2 tree building backend * result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax result/HTML/wired.html.sax: this changes a few HTML SAX regression tests
Eugene Pimenov 615904f5 2010-03-15T15:16:02 Switch the HTML parser to be non-recursive * HTMLparser.c: new htmlParseElementInternal non recursive, with htmlParseContentInternal and new function to handle node info and element end. * include/libxml/parser.h: add new stack for element info in parser context * parserInternals.c: fee element info stack
Eugene Pimenov ef9c636a 2010-03-15T11:37:48 Cleanup a couple of weirdness in HTML parser
Eugene Pimenov 1e60fbcb 2010-03-10T18:10:49 htmlCheckEncoding doesn't update input-end after shrink * HTMLparser.c: add the missing update to the end pointer
Daniel Veillard e20fb5a7 2010-01-29T20:47:08 Fix xmlParseInNodeContext for HTML content xmlParseInNodeContext notices that the enclosing document is an HTML document, so invoke the HTML parser for that fragment, and the HTML parser finding a "<p>hello world!</p>" document automatically augment it with defaulted <html> and <body>. This defaulting should be turned off in the HTML parser for this to work, but there is no such HTML parser option. There is an htmlOmittedDefaultValue global variable that you could use, but really we should not rely on global variable for processing options anymore, best is to add an HTML_PARSE_NOIMPLIED. * include/libxml/HTMLparser.h: add the HTML_PARSE_NOIMPLIED parser flag * HTMLparser.c: do add implied element if HTML_PARSE_NOIMPLIED is set * parser.c: add HTML_PARSE_NOIMPLIED to options for xmlParseInNodeContext on HTML documents
Eugene Pimenov 4b41f15d 2010-01-20T14:25:59 Fix some missing commas in HTML element lists * HTMLparse.c: fix the macros BLOCK and INLINE to use commas and avoid transparent contatenation of strings
Daniel Veillard 13cee4e3 2009-09-05T14:52:55 Fix a bunch of scan 'dead increments' and cleanup * HTMLparser.c c14n.c debugXML.c entities.c nanohttp.c parser.c testC14N.c uri.c xmlcatalog.c xmllint.c xmlregexp.c xpath.c: fix unused variables, or unneeded increments as well as a couple of space issues * runtest.c: check for NULL before calling unlink()
Daniel Veillard eeb99329 2009-08-25T14:42:16 444994 HTML chunked failure for attribute with <> * HTMLparser.c: fix htmlParseLookupSequence to not save ctxt->checkIndex when the current buffer ends within an attribute value, as this information would be missed in next pass.
Adiel Mittmann 8a103793 2009-08-25T11:27:13 Non ASCII character may be split at buffer end * HTMLparser.c: make sure when we call xmlParserInputGrow in htmlCurrentChar, to reset the current pointer
Markus Kull 56a03035 2009-08-24T19:00:23 572129 speed up parasing of large HTML text nodes * HTMLparser.c: use a different lookup function htmlParseLookupChars() to avoid the quadratic behaviour
Daniel Veillard b468f744 2009-08-24T18:45:33 Remove a pedantic warning
Daniel Veillard 856c668c 2009-08-24T18:16:56 Fix HTML parsing with 0 character in CDATA * HTMLparser.c: 0 before the end of the input need some special case handling, raise the error and return a space instead
Daniel Veillard 029a04d2 2009-08-24T12:50:23 541335 HTML avoid creating 2 head or 2 body element * HTMLparser.c: check when we see an head or a body tag and avoid autogenerating them * include/libxml/parser.h: the values for ctxt->html change depending on the head or body tags being seen
Daniel Veillard 6339c1a8 2009-08-24T11:59:51 541237 error correcting missing end tags in HTML * HTMLparser.c: make sure /p closes the FONTSTYLE list of elements
Daniel Veillard db4ac221 2009-08-22T17:58:31 Fix a small problem on previous HTML parser patch
Daniel Veillard e77db16a 2009-08-22T11:32:38 592430 - HTML parser runs into endless loop * HTMLparser.c: fix the problem with detection erroring absolutely, and properly popping up the stack when in EOF, also passes XML_PARSE_HUGE when decoding options.
Daniel Veillard 7459c595 2009-08-13T10:10:29 588441 allow '.' in HTML Names even if invalid * HTMLparser.c: just allow '.' in htmlParseHTMLName list of characters
Daniel Veillard 533ec0e0 2009-08-12T20:13:38 579317 Try to find the HTML encoding information * HTMLparser.c: if we hit an encoding error before parsing a potential <meta> with the info look in the input buffer to see if we can find it instead of forcing a blind switch to ISO-8859-1
Jiri Netolicky 446e126d 2009-08-07T17:05:36 576368 – htmlChunkParser with special attributes * HTMLparser.c: htmlChunkParsing failed when the chunk ends inside element after some attribute which has a '>' char in its value.
Daniel Veillard 4d3e2da7 2009-05-15T17:55:45 * HTMLparser.c: make sure we keep line numbers fixes #580705 based Aaron Patterson patch Daniel
Roland Steiner 04f8eef8 2009-05-12T09:16:16 * HTMLparser.c: a broken HTML table attributes initialization, fixes #581803, by Roland Steiner <rolandsteiner@google.com> Daniel
Daniel Veillard 7f4547cd 2008-10-03T07:58:23 preparing the release of 2.7.2 fix the Solaris portability issue * configure.in doc/* NEWS: preparing the release of 2.7.2 * dict.c: fix the Solaris portability issue * parser.c: additional cleanup on #554660 fix * test/ent13 result/ent13* result/noent/ent13*: added the example in the regression test suite. * HTMLparser.c: handle leading BOM in htmlParseElement() Daniel svn path=/trunk/; revision=3799
Daniel Veillard a57ba4ce 2008-09-25T16:06:18 fix an HTML parsing error on large data sections reported by Mike Day add * HTMLparser.c: fix an HTML parsing error on large data sections reported by Mike Day * test/HTML/utf8bug.html result/HTML/utf8bug.html.err result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the reproducer to the test suite daniel svn path=/trunk/; revision=3797
Daniel Veillard 4cc67bb7 2008-08-29T19:58:23 patch from Robert Schwebel , allows to compile the example if configured * doc/examples/reader3.c: patch from Robert Schwebel , allows to compile the example if configured without output support fixes #545582 * Makefile.am: add testrecurse to the make check tests * HTMLparser.c: if the parser got a encoding argument it should be used over what the meta specifies, patch fixing #536346 Daniel svn path=/trunk/; revision=3785
Daniel Veillard ae0765b6 2008-07-31T19:54:59 more progresses against the official regression tests small cleanup for * runxmlconf.c: more progresses against the official regression tests * runsuite.c: small cleanup for non-leak reports * include/libxml/tree.h: parsing flags and other properties are now added to the document node, this is generally useful and allow to make Name and NmToken validations based on the parser flags, more specifically the 5th edition of XML or not * HTMLparser.c tree.c: small side effects for the previous changes * parser.c SAX2.c valid.c: the bulk of teh changes are here, the parser and validation behaviour can be affected, parsing flags need to be copied, lot of changes. Also fixing various validation problems in the regression tests. Daniel svn path=/trunk/; revision=3762
Daniel Veillard ed86dc23 2008-04-24T11:58:41 applied patch from Ashwin fixing a number of realloc problems improve * uri.c: applied patch from Ashwin fixing a number of realloc problems * HTMLparser.c: improve handling for misplaced html/head/body Daniel svn path=/trunk/; revision=3740
Daniel Veillard 36de63e7 2008-04-03T09:05:05 apparently it's okay to forget the semicolumn after entity refs in HTML, * HTMLparser.c: apparently it's okay to forget the semicolumn after entity refs in HTML, fixing char refs parsing accordingly based on T. Manske patch, this should fix #517653 Daniel svn path=/trunk/; revision=3726
Daniel Veillard 35fcbb84 2008-03-12T21:43:39 patch from Arnold Hendriks improving parsing of html within html bogus * HTMLparser.c: patch from Arnold Hendriks improving parsing of html within html bogus data, still not a complete fix though Daniel svn path=/trunk/; revision=3704
Daniel Veillard c5b43cc0 2008-01-11T07:41:39 avoid stopping parsing when encountering out of range characters in an * HTMLparser.c: avoid stopping parsing when encountering out of range characters in an HTML file, report and continue processing instead, should fix #472696 Daniel svn path=/trunk/; revision=3675
Daniel Veillard 640f89ef 2008-01-11T06:24:09 fix definition for <embed> to avoid error when saving back, patch from * HTMLparser.c: fix definition for <embed> to avoid error when saving back, patch from Stefan Behnel fixing 495213 Daniel svn path=/trunk/; revision=3671
Daniel Veillard 861101d1 2007-06-12T08:38:57 fixed bug #381877, avoid reading over the end of stream when generating an * HTMLparser.c: fixed bug #381877, avoid reading over the end of stream when generating an UTF-8 encoding error. Daniel svn path=/trunk/; revision=3627
Daniel Veillard 491e58e5 2007-05-02T16:15:18 applied patch from Michael Day to add support for <embed> Daniel * HTMLparser.c: applied patch from Michael Day to add support for <embed> Daniel svn path=/trunk/; revision=3611
Daniel Veillard 739e9d09 2007-04-27T09:33:58 Dohh ! Daniel svn path=/trunk/; revision=3610
Daniel Veillard 4d1320fa 2007-04-26T08:55:33 Jean-Daniel Dupas pointed a couple of problems in htmlCreateDocParserCtxt. * HTMLparser.c: Jean-Daniel Dupas pointed a couple of problems in htmlCreateDocParserCtxt. Daniel svn path=/trunk/; revision=3609