Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.39k stars 316 forks source link

`toTextArea()` no longer functions in 2.11.0 #217

Open charsleysa opened 4 years ago

charsleysa commented 4 years ago

Describe the bug Calling toTextArea() results in an exception:

Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

To Reproduce Steps to reproduce the behavior:

  1. Call the toTextArea() function on an instance of EasyMDE.

https://stackblitz.com/edit/js-r8f7lh

Expected behavior Text area to be successfully restored and EasyMDE disposed.

Version information

Additional context Issue does not occur in 2.10.1, only started occuring in 2.11.0 Seems to be related to changing the DOM hierarchy by adding another container div which causes issues with the underlying CodeMirror toTextArea() function code.

nick-denry commented 4 years ago

Hi, @charsleysa

Could you please try now the master branch?

dgmid commented 4 years ago

I have an electron app that is using easymde and I have the same error using 2.11.0 I can confirm that the fix on the master branch works for me.