return t.type is TYPE_TEXT && t.text.length is 1 and space_chars.indexOf(t.text) > -1
is_input_hidden_tok = (t) ->
- return unless t.type is TYPE_START_TAG
- for a of t.attrs_a
+ return false unless t.type is TYPE_START_TAG
+ for a in t.attrs_a
if a[0] is 'type'
if a[1].toLowerCase() is 'hidden'
return true
el = insert_html_element t
head_element_pointer = el
ins_mode = ins_mode_in_head
+ return
if t.type is TYPE_END_TAG
if t.name is 'head' or t.name is 'body' or t.name is 'html' or t.name is 'br'
# fall through to Anything else below
if t.type is TYPE_START_TAG and t.name is 'title'
parse_generic_rcdata_text t
return
- if t.type is TYPE_START_TAG and ((t.name is 'noscript' and flag_scripting) or (t.name is 'noframes' or t.name is 'style'))
+ if t.type is TYPE_START_TAG and ((t.name is 'noscript' and flag_scripting) or t.name is 'noframes' or t.name is 'style')
parse_generic_raw_text t
return
if t.type is TYPE_START_TAG and t.name is 'noscript' and flag_scripting is false
if t.type is TYPE_DOCTYPE
parse_error()
return
- if t.type is TYPE_START_TAG
+ if t.type is TYPE_START_TAG and t.name is 'html'
ins_mode_in_body t
return
if t.type is TYPE_END_TAG and t.name is 'noscript'
open_els.shift()
ins_mode = ins_mode_in_head
return
- if (t.type is TYPE_TEXT and (t.text is "\t" or t.text is "\u000a" or t.text is "\u000c" or t.text is "\u000d" or t.text is ' ')) or t.type is TYPE_COMMENT or (t.type is TYPE_START_TAG and (t.name is 'basefont' or t.name is 'bgsound' or t.name is 'link' or t.name is 'meta' or t.name is 'noframes' or t.name is 'style'))
+ if is_space_tok(t) or t.type is TYPE_COMMENT or (t.type is TYPE_START_TAG and (t.name is 'basefont' or t.name is 'bgsound' or t.name is 'link' or t.name is 'meta' or t.name is 'noframes' or t.name is 'style'))
ins_mode_in_head t
return
if t.type is TYPE_END_TAG and t.name is 'br'
return
# Otherwise
parse_error()
- tok_cur_tag = new_comment_token '!' # TODO test ("!" right?)
+ tok_cur_tag = new_comment_token ''
tok_state = tok_state_bogus_comment
return
tok_state = tok_state_comment_start_dash
when "\u0000"
parse_error()
+ tok_state = tok_state_comment
return new_character_token "\ufffd"
when '>'
parse_error()
return tok_cur_tag
else
tok_cur_tag.text += c
+ tok_state = tok_state_comment
return null
# 8.2.4.47 http://www.w3.org/TR/html5/syntax.html#comment-start-dash-state
# tokenizer initialization
tok_state = tok_state_data
+ if args.name is "one_that_breaks #1"
+ throw "hi" # console.log "hi"
# proccess input
# http://www.w3.org/TR/html5/syntax.html#tree-construction
while flag_parsing