Handbook
Glossary
markup-declaration-open-state ( document n/f string -- document n'/f string )
Vocabulary
html5
Inputs
document
an
object
n/f
an
object
string
an
object
Outputs
document
an
object
n'/f
an
object
string
an
object
Definition
USING:
accessors
combinators
kernel
modern.slices
sequences
;
IN:
html5
:
markup-declaration-open-state
( document n/f string -- document n'/f string )
{
{
[
"--"
take-markup?
]
[
comment-start-state
]
}
{
[
"DOCTYPE"
take-from-insensitive?
]
[
pick
<doctype>
>>doctype
drop
doctype-state
]
}
{
[
"[CDATA["
take-markup?
]
[
pick
open-elements>>
?last
[
html-element?
not
]
[
f
]
if*
[
cdata-section-state
]
[
"cdata-in-html-content"
report-parse-error
"[CDATA["
reach
push-all-comment-token
bogus-comment-state
]
if
]
}
[
"incorrectly-opened-comment"
report-parse-error
bogus-comment-state
]
}
cond
;