1 USING: html.parser kernel tools.test ;
4 V{ T{ tag f "html" H{ } f f } }
5 } [ "<html>" parse-html ] unit-test
8 V{ T{ tag f "html" H{ } f t } }
9 } [ "</html>" parse-html ] unit-test
12 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
13 } [ "<a href=\"http://factorcode.org/\">" parse-html ] unit-test
16 V{ T{ tag f "a" H{ { "href" "http://factorcode.org/" } } f f } }
17 } [ "<a href = \"http://factorcode.org/\" >" parse-html ] unit-test
25 H{ { "baz" "\"quux\"" } { "foo" "bar's" } }
30 } [ "<a foo=\"bar's\" baz='\"quux\"' >" parse-html ] unit-test
38 { "href" "http://factorcode.org/" }
42 } [ "<a href = \"http://factorcode.org/\" foo = bar baz='quux'a=pirsqd >" parse-html ] unit-test
50 { "href" "http://factorcode.org/" }
52 { "nofollow" "nofollow" }
55 } [ "<a href = \"http://factorcode.org/\" nofollow foo = bar baz='quux'a=pirsqd >" parse-html ] unit-test
59 T{ tag f "html" H{ } f f }
60 T{ tag f "head" H{ } f f }
61 T{ tag f "head" H{ } f t }
62 T{ tag f "html" H{ } f t }
64 } [ "<html<head</head</html" parse-html ] unit-test
68 T{ tag f "head" H{ } f f }
69 T{ tag f "title" H{ } f f }
70 T{ tag f text f "Spagna" f }
71 T{ tag f "title" H{ } f t }
72 T{ tag f "head" H{ } f t }
74 } [ "<head<title>Spagna</title></head" parse-html ] unit-test
81 "DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Draft//EN\""
87 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Draft//EN\">"
93 T{ tag { name comment } { text "comment" } }
96 "<!--comment-->" parse-html
99 ! Issue #1233, trailing / in tags
104 { attributes H{ { "src" "http://factorcode.org" } } }
108 [ "<img src=\"http://factorcode.org\">" parse-html ] unit-test
114 { attributes H{ { "src" "http://factorcode.org" } } }
118 [ "<img src=\"http://factorcode.org\"/>" parse-html ] unit-test
124 { attributes H{ { "src" "http://factorcode.org" } } }
128 [ "<img src=\"http://factorcode.org\"////////>" parse-html ] unit-test