Handbook
Glossary
text-printer
Vocabulary
html
.
parser
.
printer
Definition
IN:
html.parser.printer
TUPLE:
text-printer
<
html-printer
;
Methods
USING:
accessors
combinators
html.parser.printer
io
kernel
namespaces
sequences
;
M:
text-printer
print-closing-tag
name>>
{
[
"blockquote"
=
[
#indentations
dec
]
when
]
[
{
"p"
"blockquote"
"h1"
"h2"
"h3"
"h4"
"h5"
}
member?
[
nl
indent
nl
indent
]
when
]
[
{
"ul"
"ol"
"li"
"tr"
}
member?
[
nl
indent
]
when
]
[
{
"th"
"td"
}
member?
[
bl
]
when
]
[
"pre"
=
[
preformatted?
off
]
when
]
[
"script"
=
[
script?
off
]
when
]
[
"style"
=
[
style?
off
]
when
]
}
cleave
;
USING:
html.parser.printer
kernel
;
M:
text-printer
print-comment-tag
drop
;
USING:
html.parser.printer
kernel
;
M:
text-printer
print-dtd-tag
drop
;
USING:
accessors
combinators
html.parser.printer
io
kernel
namespaces
;
M:
text-printer
print-opening-tag
name>>
{
{
"br"
[
nl
indent
]
}
{
"ol"
[
nl
indent
]
}
{
"ul"
[
nl
indent
]
}
{
"li"
[
" * "
write
]
}
{
"blockquote"
[
#indentations
inc
indent
]
}
{
"pre"
[
preformatted?
on
]
}
{
"script"
[
script?
on
]
}
{
"style"
[
style?
on
]
}
[
drop
]
}
case
;
USING:
accessors
html.parser.printer
io
kernel
namespaces
;
M:
text-printer
print-text-tag
script?
get
style?
get
or
[
drop
]
[
text>>
collapse-spaces
write
]
if
;