2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-23 01:44:31 -06:00

Fix toTextArea issue

Solves https://github.com/Ionaru/easy-markdown-editor/issues/217
This commit is contained in:
Nick Denry 2020-08-08 00:22:06 +03:00 committed by GitHub
parent 754bdc3ab2
commit 55312d8ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2743,6 +2743,7 @@ EasyMDE.prototype.getState = function () {
EasyMDE.prototype.toTextArea = function () {
var cm = this.codemirror;
var wrapper = cm.getWrapperElement();
var easyMDEContainer = wrapper.parentNode;
if (wrapper.parentNode) {
if (this.gui.toolbar) {
@ -2756,6 +2757,10 @@ EasyMDE.prototype.toTextArea = function () {
}
}
// Unwrap easyMDEcontainer before codemirror toTextArea() call
easyMDEContainer.parentNode.insertBefore(wrapper, easyMDEContainer);
easyMDEContainer.remove();
cm.toTextArea();
if (this.autosaveTimeoutId) {