From: Jason Woofenden Date: Thu, 24 Dec 2015 04:44:27 +0000 (-0500) Subject: fix minor parsing bugs X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=5addabc209b9abfce9b8d2f88cfba910c54f5ac6 fix minor parsing bugs --- 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