diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js index 17cf9be1ff..d45d8ec6d3 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js @@ -74,6 +74,7 @@ export default Component.extend({ init() { this._super(...arguments); this.SPECIAL_MARKUPS = []; + this._lastSetHtml = this.html; }, didReceiveAttrs() { @@ -81,8 +82,9 @@ export default Component.extend({ // reset local mobiledoc if html has been changed upstream so that // the html will be re-parsed by the mobiledoc-kit editor - if (this.cleanHTML !== this._getHTML()) { + if (this._lastSetHtml !== this.html) { this.set('mobiledoc', null); + this._lastSetHtml = this.html; } }, @@ -343,7 +345,9 @@ export default Component.extend({ postDidChange() { // trigger closure action - this.onChange(this._getHTML()); + const html = this._getHTML(); + this._lastSetHtml = html; + this.onChange(html); }, cursorDidChange(editor) {