diff --git a/extra/html/parser/parser-tests.factor b/extra/html/parser/parser-tests.factor index ca276fc54e..2876d03b16 100644 --- a/extra/html/parser/parser-tests.factor +++ b/extra/html/parser/parser-tests.factor @@ -73,3 +73,26 @@ V{ T{ tag f "head" H{ } f t } } ] [ "
Spagna" + parse-html +] unit-test + +[ +V{ + T{ tag { name comment } { text "comment" } } +} +] [ + "" parse-html +] unit-test diff --git a/extra/html/parser/parser.factor b/extra/html/parser/parser.factor index d95c79dd88..948bd0c954 100644 --- a/extra/html/parser/parser.factor +++ b/extra/html/parser/parser.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays hashtables sequence-parser -html.parser.utils kernel namespaces sequences +html.parser.utils kernel namespaces sequences math unicode.case unicode.categories combinators.short-circuit quoting fry ; IN: html.parser @@ -63,10 +63,12 @@ SYMBOL: tagstack [ blank? ] trim ; : read-comment ( sequence-parser -- ) - "-->" take-until-sequence comment new-tag push-tag ; + [ "-->" take-until-sequence comment new-tag push-tag ] + [ '[ _ advance drop ] 3 swap times ] bi ; : read-dtd ( sequence-parser -- ) - ">" take-until-sequence dtd new-tag push-tag ; + [ ">" take-until-sequence dtd new-tag push-tag ] + [ advance drop ] bi ; : read-bang ( sequence-parser -- ) advance dup { [ current CHAR: - = ] [ peek-next CHAR: - = ] } 1&&