summaryrefslogtreecommitdiff
path: root/result
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-07-15 14:02:26 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-08-02 14:38:09 +0200
commite986d09cf531e77a9ab46af2d1a219072f310190 (patch)
treee969d53c6e139d29e994b637034344760f7c4bba /result
parent6722d22c8821d04bd57b15c46e90b6aa69530958 (diff)
downloadlibxml2-e986d09cf531e77a9ab46af2d1a219072f310190.tar.gz
Skip incorrectly opened HTML comments
Commit 4fd69f3e fixed handling of '<' characters not followed by an ASCII letter. But a '<!' sequence followed by invalid characters should be treated as bogus comment and skipped. Fixes #380.
Diffstat (limited to 'result')
-rw-r--r--result/HTML/issue380.html6
-rw-r--r--result/HTML/issue380.html.err6
-rw-r--r--result/HTML/issue380.html.sax20
3 files changed, 32 insertions, 0 deletions
diff --git a/result/HTML/issue380.html b/result/HTML/issue380.html
new file mode 100644
index 00000000..1fcf4965
--- /dev/null
+++ b/result/HTML/issue380.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+ <body>
+ ...
+ </body>
+</html>
diff --git a/result/HTML/issue380.html.err b/result/HTML/issue380.html.err
new file mode 100644
index 00000000..efbb8bdf
--- /dev/null
+++ b/result/HTML/issue380.html.err
@@ -0,0 +1,6 @@
+./test/HTML/issue380.html:3: HTML parser error : Incorrectly opened comment
+ <![if !supportLists]>...<![endif]>
+ ^
+./test/HTML/issue380.html:3: HTML parser error : Incorrectly opened comment
+ <![if !supportLists]>...<![endif]>
+ ^
diff --git a/result/HTML/issue380.html.sax b/result/HTML/issue380.html.sax
new file mode 100644
index 00000000..5df2b506
--- /dev/null
+++ b/result/HTML/issue380.html.sax
@@ -0,0 +1,20 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+ , 3)
+SAX.startElement(body)
+SAX.characters(
+ , 5)
+SAX.error: Incorrectly opened comment
+SAX.characters(..., 3)
+SAX.error: Incorrectly opened comment
+SAX.characters(
+ , 3)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()