From 5e063be4c624b39f7e066b9674239fd81e471773 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 6 Jun 2017 22:18:39 -0400 Subject: [PATCH] change parser api again --- editor.js | 4 ++-- parser.js | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/editor.js b/editor.js index 66b835b..977ca9e 100644 --- a/editor.js +++ b/editor.js @@ -1674,9 +1674,9 @@ PeachHTML5Editor.prototype.clear_dom = function() { this.kill_cursor() } PeachHTML5Editor.prototype.load_html = function(html) { - this.tree = peach_parser(html, this.parser_opts) + this.tree = peach_parser.parse(html, this.parser_opts) if (this.tree[0] == null ? true : this.tree[0].parent == null) { - this.tree = peach_parser('

', this.parser_opts) + this.tree = peach_parser.parse('

', this.parser_opts) } this.tree_parent = this.tree[0].parent this.tree_parent.el = this.idoc.body diff --git a/parser.js b/parser.js index e29b3bd..1bbc57b 100644 --- a/parser.js +++ b/parser.js @@ -6070,12 +6070,15 @@ parse_html = function (args_html, args) { return doc.children } +var this_module = { + parse: parse_html, + Node: Node, +} + if (context === 'module') { - module.exports = parse_html + module.exports = this_module } else { - window.peach_parser = parse_html + window.peach_parser = this_module } -parse_html.Node = Node - }).call(this) -- 1.7.10.4