From 686f249babbea242c87f2eba6191f64504b97944 Mon Sep 17 00:00:00 2001 From: Alyssa Herzog Date: Sat, 18 Jun 2016 18:42:29 -0400 Subject: [PATCH] Fixes an issue with Chrome 52 and Firefox 47 (and potentially other browsers) where calling pen.destroy() and then pen.rebuild() causes the markdown converter's onKeypress event handler to stop handling events. --- src/pen.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pen.js b/src/pen.js index 3819be2..8aaf4a5 100755 --- a/src/pen.js +++ b/src/pen.js @@ -512,7 +512,7 @@ this._prevContent = this.getContent(); // enable markdown covert - if (this.markdown) this.markdown.init(this); + //if (this.markdown) this.markdown.init(this); // stay on the page if (this.config.stay) this.stay(this.config); @@ -782,6 +782,7 @@ } else { initToolbar(this); initEvents(this); + if (this.markdown) this.markdown.init(this); } this._isDestroyed = destroy; this.config.editor[attr]('contenteditable', '');