1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

html: Don't abort on encoding errors

Always enable recovery mode when parsing HTML, so we don't raise fatal
errors.

Regressed with 462bf0b7. Fixes #947.
This commit is contained in:
Nick Wellnhofer
2025-07-10 11:20:22 +02:00
parent 3773bb3f89
commit bc0bb67b57
5 changed files with 46 additions and 0 deletions

View File

@@ -5524,6 +5524,11 @@ htmlCtxtSetOptionsInternal(xmlParserCtxtPtr ctxt, int options, int keepMask)
*/
ctxt->keepBlanks = (options & HTML_PARSE_NOBLANKS) ? 0 : 1;
/*
* Recover from character encoding errors
*/
ctxt->recovery = 1;
/*
* Changing SAX callbacks is a bad idea. This should be fixed.
*/