</html>
]] string>html
] unit-test
+
+
+! Handle tabs
+{
+V{
+ T{ open-tag
+ { open "<" }
+ { name "label" }
+ { props
+ V{
+ {
+ "id"
+ T{ dquote { payload "p-personal-label" } }
+ }
+ {
+ "class"
+ T{ dquote
+ { payload "vector-menu-heading " }
+ }
+ }
+ }
+ }
+ { close ">" }
+ { children
+ V{
+ T{ open-tag
+ { open "<" }
+ { name "span" }
+ { props
+ V{
+ {
+ "class"
+ T{ dquote
+ { payload
+ "vector-menu-heading-label"
+ }
+ }
+ }
+ }
+ }
+ { close ">" }
+ { children V{ "Personal tools" } }
+ { close-tag T{ close-tag { name "span" } } }
+ }
+ }
+ }
+ { close-tag T{ close-tag { name "label" } } }
+ }
+}
+} [
+[[
+ <label
+ id="p-personal-label"
+
+ class="vector-menu-heading "
+ >
+ <span class="vector-menu-heading-label">Personal tools</span>
+ </label>
+]] string>html
+] unit-test
} case ;
: read-prop ( n string -- n' string prop/f closing/f )
- skip-whitespace "\s\n\r\"'<=/>?" slice-til-either {
+ skip-whitespace "\s\n\r\t\"'<=/>?" slice-til-either {
{ CHAR: < [ "< error" throw ] }
{ CHAR: = [ 1 split-slice-back drop >string [ read-value ] dip swap 2array f ] }
{ CHAR: / [ ">" expect-and-span 2 split-slice-back [ >string f like ] bi@ ] }
{ CHAR: \s [ >string f ] }
{ CHAR: \r [ >string f ] }
{ CHAR: \n [ >string f ] }
+ { CHAR: \t [ >string f ] }
{ f [ "efff" throw ] }
} case ;
:: slice-til-not-whitespace ( n string -- n' string slice/f ch/f )
n [
- n string [ "\s\r\n" member? not ] find-from :> ( n' ch )
+ n string [ "\s\r\n\t" member? not ] find-from :> ( n' ch )
n' string
n n' string ?<slice>
ch