DEV Community

Tymur Levtsun
Tymur Levtsun

Posted on

Made Markdown parsing great again

Hi, it is finally time to make a nice and stable markdown processing. The idea to implement came from docusaurus which is the tool or I would probably even call it framework for creating documentation fast and easily.

Requriments

The first important decision that I had to make to implement that feature is to find a nice package which parses markdown and converts it to HTML. My criteria were the following:

  • The package has to be relatively popular (a few thousand stars on GitHub
  • It should have a typescript support

Package

Marked package turned out to be an optimal solution for this case and I went ahead and used it. The installation and integration process was pretty straightforward.

Implementation

The integration of the marked package shorted the getSerializedHtmlFromMd() function code from about 40 lines to just 6 lines and now it looks way cleaner and professional. Additionally, now it supports most or all markdown features which are available which is also a really good thing.

Implementation

First of all, I created the issue for izyum where I briefly described what I want to do and how I am going to achieve it. After that, I made an implementation and created PR, which approved myself :)

Top comments (0)