1 USING: html.parser kernel tools.test ;
5 V{ T{ tag f "html" H{ } f f } }
6 ] [ "<html>" parse-html ] unit-test
9 V{ T{ tag f "html" H{ } f t } }
10 ] [ "</html>" parse-html ] unit-test
13 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
14 ] [ "<a href=\"http://factorcode.org/\">" parse-html ] unit-test
17 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
18 ] [ "<a href = \"http://factorcode.org/\" >" parse-html ] unit-test
26 H{ { "baz" "\"quux\"" } { "foo" "bar's" } }
31 ] [ "<a foo=\"bar's\" baz='\"quux\"' >" parse-html ] unit-test
39 { "href" "http://factorcode.org/" }
43 ] [ "<a href = \"http://factorcode.org/\" foo = bar baz='quux'a=pirsqd >" parse-html ] unit-test
51 { "href" "http://factorcode.org/" }
53 { "nofollow" "nofollow" }
56 ] [ "<a href = \"http://factorcode.org/\" nofollow foo = bar baz='quux'a=pirsqd >" parse-html ] unit-test
60 T{ tag f "html" H{ } f f }
61 T{ tag f "head" H{ } f f }
62 T{ tag f "head" H{ } f t }
63 T{ tag f "html" H{ } f t }
65 ] [ "<html<head</head</html" parse-html ] unit-test
69 T{ tag f "head" H{ } f f }
70 T{ tag f "title" H{ } f f }
71 T{ tag f text f "Spagna" f }
72 T{ tag f "title" H{ } f t }
73 T{ tag f "head" H{ } f t }
75 ] [ "<head<title>Spagna</title></head" parse-html ] unit-test
82 "DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Draft//EN\""
88 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Draft//EN\">"
94 T{ tag { name comment } { text "comment" } }
97 "<!--comment-->" parse-html