From 957fdcf2a3520ee18c6f148d504e326bff981cb2 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 6 Nov 2001 22:50:19 +0000 Subject: [PATCH] handle the case of < in quoted attributes, Bastian Kleineidam Daniel * HTMLparser.c test/HTML/lt.html result/HTML/lt.html*: handle the case of < in quoted attributes, Bastian Kleineidam Daniel --- ChangeLog | 5 +++++ HTMLparser.c | 3 ++- result/HTML/lt.html | 2 ++ result/HTML/lt.html.err | 0 result/HTML/lt.html.sax | 19 +++++++++++++++++++ test/HTML/lt.html | 5 +++++ 6 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 result/HTML/lt.html create mode 100644 result/HTML/lt.html.err create mode 100644 result/HTML/lt.html.sax create mode 100644 test/HTML/lt.html diff --git a/ChangeLog b/ChangeLog index a21e5bf0..ff07a2f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 6 23:49:09 CET 2001 Daniel Veillard + + * HTMLparser.c test/HTML/lt.html result/HTML/lt.html*: + handle the case of < in quoted attributes, Bastian Kleineidam + Tue Nov 6 16:21:33 CET 2001 Daniel Veillard * configure.in include/libxml/xmlwin32version.h: releasing 2.4.9 diff --git a/HTMLparser.c b/HTMLparser.c index da4666c0..af941a0e 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -1970,7 +1970,8 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) { /* * Ok loop until we reach one of the ending chars */ - while ((CUR != 0) && (CUR != stop) && (CUR != '>')) { + while ((CUR != 0) && (CUR != stop)) { + if ((stop == 0) && (CUR == '>')) break; if ((stop == 0) && (IS_BLANK(CUR))) break; if (CUR == '&') { if (NXT(1) == '#') { diff --git a/result/HTML/lt.html b/result/HTML/lt.html new file mode 100644 index 00000000..90e3c20d --- /dev/null +++ b/result/HTML/lt.html @@ -0,0 +1,2 @@ + + diff --git a/result/HTML/lt.html.err b/result/HTML/lt.html.err new file mode 100644 index 00000000..e69de29b diff --git a/result/HTML/lt.html.sax b/result/HTML/lt.html.sax new file mode 100644 index 00000000..a4ab5e37 --- /dev/null +++ b/result/HTML/lt.html.sax @@ -0,0 +1,19 @@ +SAX.setDocumentLocator() +SAX.startDocument() +SAX.startElement(html) +SAX.ignorableWhitespace( +, 1) +SAX.startElement(head) +SAX.ignorableWhitespace( +, 1) +SAX.startElement(meta, name='Author', content='Root <root@aol.com>') +SAX.endElement(meta) +SAX.ignorableWhitespace( +, 1) +SAX.endElement(head) +SAX.ignorableWhitespace( +, 1) +SAX.endElement(html) +SAX.ignorableWhitespace( +, 1) +SAX.endDocument() diff --git a/test/HTML/lt.html b/test/HTML/lt.html new file mode 100644 index 00000000..62f6d942 --- /dev/null +++ b/test/HTML/lt.html @@ -0,0 +1,5 @@ + + + + +