X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=parser.coffee;h=7992244053dcc16edfdee5e4b5d247e5b0abf58c;hb=432cb1b77561b5168df32d27703f5b642b6c285f;hp=804c257a6fe3801dda8c7a3bab600c735102b31a;hpb=a7cff3a244ba086034aed2f284235b6bcb6b7f98;p=peach-html5-editor.git diff --git a/parser.coffee b/parser.coffee index 804c257..7992244 100644 --- a/parser.coffee +++ b/parser.coffee @@ -43,11 +43,11 @@ # # Call it like this: # -# wheic_parser.parse("

hi

") +# peach_parser.parse("

hi

") # # Or, if you don't want /etc, do this: # -# wheic_parser.parse("

hi

", {fragment: "body"}) +# peach_parser.parse("

hi

", {fragment: "body"}) # # return value is an array of Nodes, see "class Node" below. @@ -80,8 +80,8 @@ if (typeof module) isnt 'undefined' and module.exports? exports = module.exports else context = 'browser' - window.wheic_parser = {} - exports = window.wheic_parser + window.peach_parser = {} + exports = window.peach_parser from_code_point = (x) -> if String.fromCodePoint? @@ -322,9 +322,9 @@ legacy_char_refs = { yen: '¥', yuml: 'ÿ' } -void_elements = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'] -raw_text_elements = ['script', 'style'] -escapable_raw_text_elements = ['textarea', 'title'] +#void_elements = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'] +#raw_text_elements = ['script', 'style'] +#escapable_raw_text_elements = ['textarea', 'title'] # http://www.w3.org/TR/SVG/ 1.1 (Second Edition) svg_elements = [ 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', @@ -1246,6 +1246,7 @@ parse_html = (args_html, args = {}) -> prev.text += t.text return dest[0].children.splice dest[1], 0, t + t.parent = dest[0] return # 8.2.5 http://www.w3.org/TR/html5/syntax.html#tree-construction