diff --git a/src/js/editor/editor.js b/src/js/editor/editor.js index cb5401f50..496e4dde8 100644 --- a/src/js/editor/editor.js +++ b/src/js/editor/editor.js @@ -114,7 +114,8 @@ class Editor { return mobiledocParsers.parse(this.builder, this.mobiledoc); } else if (this.html) { if (typeof this.html === 'string') { - return new HTMLParser(this.builder).parse(this.html); + let options = {plugins: this._parserPlugins}; + return new HTMLParser(this.builder, options).parse(this.html); } else { let dom = this.html; return this._parser.parse(dom); diff --git a/tests/unit/editor/editor-test.js b/tests/unit/editor/editor-test.js index c0c530544..4633b0f9e 100644 --- a/tests/unit/editor/editor-test.js +++ b/tests/unit/editor/editor-test.js @@ -299,3 +299,15 @@ test('#destroy does not clear selection if it is outside the editor element', (a assert.equal(window.getSelection().rangeCount, 1, 'selection is not cleared'); }); + +test('editor parses HTML post using parser plugins', (assert) => { + let seenTagNames = []; + let parserPlugin = function(element) { + seenTagNames.push(element.tagName); + }; + let html = '