Simplemde-markdown-editor: How to render markdown text after saving it in database

Created on 30 May 2017  路  7Comments  路  Source: sparksuite/simplemde-markdown-editor

I'm using this in my application.

This is working fine as data is saving to database with markdown syntax.

Now, I want to render this data on a separate file.

How to render the data on view?

Most helpful comment

The editor has a built-in markdown renderer, which it uses to display markdown as HTML. We're arguing that that renderer should be exposed so we don't have to load a whole other renderer when there is already one included in SimpleMDE.

For anyone reading this, you can currently use the built-in renderer simply by calling:

~js
simplemde.markdown(simplemde.value)
~

All 7 comments

this is not an issue of this editor, its your job to find a solution to render md-files - there are many solutions out there.

I also need to render data, and I don't want to use a separate solution that duplicates exactly what this plugin does, as that both duplicates the code and might not even support the same subset of Markdown that this does. Exposing the rendered text would be a very nice feature.

It's up to the back-end framework , for example in django I use markdown before rendering the data, so there will be a way in your language or framework.

My language or framework is vanilla JS. Why should I have to load a second library when I already have one loaded?

I don't get all this editor does is append the formatting codes(** ,#, etc ) it's up-to the back-end language to store it as it is and display it with a markdown .

The editor has a built-in markdown renderer, which it uses to display markdown as HTML. We're arguing that that renderer should be exposed so we don't have to load a whole other renderer when there is already one included in SimpleMDE.

For anyone reading this, you can currently use the built-in renderer simply by calling:

~js
simplemde.markdown(simplemde.value)
~

SimpleMDE uses Marked (https://marked.js.org/) as a renderer internally, and already includes that in dependencies. So I see it pretty logical to use that library.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ferreiro picture ferreiro  路  4Comments

IonicaBizau picture IonicaBizau  路  3Comments

mbeckenbach picture mbeckenbach  路  4Comments

andrelgarcia picture andrelgarcia  路  4Comments

rahulnjs picture rahulnjs  路  3Comments