From: Jason Woofenden Date: Thu, 24 Dec 2015 01:23:13 +0000 (-0500) Subject: fix in_table_text X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=89d356561aa91ca63239921fd8fbdbc04361aa62 fix in_table_text --- diff --git a/parse-html.coffee b/parse-html.coffee index 73eda84..9911bc0 100644 --- a/parse-html.coffee +++ b/parse-html.coffee @@ -2202,7 +2202,8 @@ parse_html = (args) -> ins_mode_in_table = (t) -> switch t.type when TYPE_TEXT - if t.name is 'table' or t.name is 'tbody' or t.name is 'tfoot' or t.name is 'thead' or t.name is 'tr' + if (open_els[0].name is 'table' or open_els[0].name is 'tbody' or open_els[0].name is 'tfoot' or open_els[0].name is 'thead' or open_els[0].name is 'tr') and open_els[0].namespace is NS_HTML + pending_table_character_tokens = [] original_ins_mode = ins_mode ins_mode = ins_mode_in_table_text process_token t @@ -2292,7 +2293,7 @@ parse_html = (args) -> # 8.2.5.4.10 http://www.w3.org/TR/html5/syntax.html#parsing-main-intabletext ins_mode_in_table_text = (t) -> if t.type is TYPE_TEXT and t.text is "\u0000" - # huh? I thought the tokenizer didn't emit these + # from javascript? parse_error() return if t.type is TYPE_TEXT @@ -2309,8 +2310,8 @@ parse_html = (args) -> insert_character old else for old in pending_table_character_tokens - ins_mode_table_else old - pending_table_character_tokens = [] # FIXME test (spec doesn't say this) + ins_mode_in_table_else old + pending_table_character_tokens = [] ins_mode = original_ins_mode process_token t