Markdown to HTML library

  node.js, question

Is there a nodejs library that integrates hexo-style markdown to html? I haven’t found it for a long time, and then I studied the hexo-renderer-marked library used in hexo for half a day, but it is still unresolved!

I would like to ask if there is a great god or a good conversion library.

Add: I have tried both the markdowm library and marked library, only the original transformation. I want the library to add some classes like the hexo transformation, such as code highlighting, line number display, etc.

I used a library. I wonder if I can help you
https://github.com/chjj/marked

I made a simple markdown reader with this library, and can play it by myself.
https://github.com/hjzheng/markdown-reader

Syntax and Code Highlighting Suggestionshttps://github.com/google/code-prettifyUse together

I haven’t tried this, but marked will

For example, the following code
Replace’ display’ with’ display’

'''css
 .class {
 background: url(data:image/gif;  base64,R0lGODl ... ) no-repeat left center;
 bracket
 '''

Turned into

<pre>
 <code class="lang-css"> .class {
 background: url(data:image/gif;  base64,R0lGODl ... ) no-repeat left center;
 bracket
 </code>
 </pre>

Combined with code-prettify, you only need to add class = “prettify print” to the pre element. you can add it in node or dynamically add it in html with js.