X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=parse-html.coffee;h=9911bc0bfc20d3b32977df53439dda01b32dbfbd;hb=89d356561aa91ca63239921fd8fbdbc04361aa62;hp=73eda84ffabceecd283782f1e4d7a90a290d10b9;hpb=af702500dd54507b24184075a7fb7c1f5acf70e5;p=peach-html5-editor.git 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