allow empty comment in HTML parser

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3091 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-03-10 10:48:25 +00:00
parent aeb698cbec
commit df66edb7c3
2 changed files with 7 additions and 0 deletions

View file

@ -231,6 +231,12 @@ RX_DATA [-a-zA-Z0-9_:]+
}
/*********************** COMMENT ************************/
<INITIAL><!> {
UPDATE_COLUMN;
SETLVAL_UNICODE;
RETURN(T_COMMENT);
}
/* Note: also accept "<! --" and "<!- " */
<INITIAL><!-- {
UPDATE_COLUMN;

View file

@ -74,6 +74,7 @@ parsetests = [
("""<!---- />-->""", """<!---- />-->"""),
("""<!-- a-2 -->< 9>""", """<!-- a-2 --><9>"""),
("""<!-- --- -->< 10>""", """<!-- --- --><10>"""),
("""<!>""", """<!---->"""), # empty comment
# invalid comments
("""<!-- -- >< 8>""", """<!-- --><8>"""),
("""<!---- >< 6>""", """<!----><6>"""),