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.32k stars 308 forks source link

Added extractYaml option #494

Open faisalraja opened 1 year ago

faisalraja commented 1 year ago

Handles yaml in front of markdown.

Ionaru commented 1 year ago

Can you add the new extractYaml option to easymde.d.ts?

faisalraja commented 1 year ago

@Ionaru can you check issue #371 I have a question there, basically maybe it should always just be yaml-frontmatter and when extractYaml is provided, then it's going to remove it from preview? Right now it's also using extractYaml to decide if we'll use yaml-frontmatter.

Ionaru commented 1 year ago

I think maybe we need to go a step further and always remove the yaml-frontmatter from the preview? Regardless of any option. I don't think there's any situation where you want to see it.

Then a extractYaml function can do something with the data if it wants, otherwise it's just sent as-is to the server.

faisalraja commented 1 year ago

@Ionaru Makes sense. Updated.