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

Returning Rendered HTML #187

Closed cryocaustik closed 4 years ago

cryocaustik commented 4 years ago

Is it possible to return the result of the default converter (marked) to allow further usage of the the converted HTML code?

cryocaustik commented 4 years ago

after reading through the source, it looks like this can be done by calling the previewRender() function:

let easymde = new EasyMeDE({ ... });

let converted = easymde.options.previewRender(easymde.value())

If this is a valid method, perhaps it could be added to the docs? I can submit a PR if you'd like.

Ionaru commented 4 years ago

It's even easier than that!

let easymde = new EasyMeDE({ ... });
let converted = easymde.markdown(easymde.value());