From 5addabc209b9abfce9b8d2f88cfba910c54f5ac6 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 23 Dec 2015 23:44:27 -0500 Subject: [PATCH] fix minor parsing bugs --- parse-html.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parse-html.coffee b/parse-html.coffee index 0fb97b9..b25359d 100644 --- a/parse-html.coffee +++ b/parse-html.coffee @@ -2726,7 +2726,8 @@ parse_html = (args) -> ins_mode_in_body t return if t.type is TYPE_COMMENT - insert_comment t, [open_els[0], open_els[0].children.length] + first = open_els[open_els.length - 1] + insert_comment t, [first, first.children.length] return if t.type is TYPE_DOCTYPE parse_error() @@ -2805,7 +2806,7 @@ parse_html = (args) -> ins_mode_in_body t return if t.type is TYPE_END_TAG and t.name is 'html' - insert_mode = ins_mode_after_after_frameset + ins_mode = ins_mode_after_after_frameset return if t.type is TYPE_START_TAG and t.name is 'noframes' ins_mode_in_head t @@ -4514,7 +4515,7 @@ parse_html = (args) -> txt = txt.replace(new RegExp("\r\n", 'g'), "\n") # fixfull spec doesn't say this txt = txt.replace(new RegExp("\r", 'g'), "\n") # fixfull spec doesn't say this - if args.name is "tests16.dat #25" + if args.name is "tests18.dat #17" console.log "hi" # proccess input # http://www.w3.org/TR/html5/syntax.html#tree-construction -- 1.7.10.4