Skip to content

Ashish-simpleCoder/simple-markdown-parser

Repository files navigation

Simple Markdown Parser

Simple Markdown Parser is a lightweight, high-performance markdown parser that converts markdown content directly into JSX. It is designed for modern React-based applications where performance, predictability, and fine-grained control over rendering are critical.

The parser avoids expensive recursive strategies and instead uses iterative list processing with caching to efficiently render ordered and unordered lists—even when deeply nested. It also supports inline HTML within markdown, checklist items, image attributes etc.

image

How It works

image

Features

  • Parse markdown into JSX.
  • Parse html present in markdown into jsx.
  • Render any amount of ol and ul list independently or nested inside each other. No Recursion. So it is very performant.
  • Caching feature for caching ol and ul list output in the mapCache too prevent going through re-generation of lists if they are not changed.
  • Render checkbox in list items.

Features & Roadmap

  • Markdown to JSX parsing
  • HTML inside markdown to JSX
  • Headings
    • # → h1
    • ## → h2
    • ### → h3
  • Inline elements
    • Bold (**bold**)
    • Italic (*italic*)
    • Inline code (`code`)
    • Links ([text](url))
  • Images
    • JSX image rendering
    • alt attribute support
    • Width & height attributes
  • Ordered & Unordered Lists (OL / UL)
    • Simple list generation
    • Nested list generation
    • Checklist parsing
      • Simple checklist
      • Checked & unchecked states
    • Non-recursive list rendering (high performance)
    • Cached list rendering using mapCache
  • Horizontal rule (hr)
  • Blockquotes
  • Code blocks
  • Paragraph rendering
  • HTML parsing as real HTML
    • HTML sanitization
    • Basic HTML parsing
  • Frontmatter support
  • Custom blocks
    • Warning
    • Info
    • Error
    • Success
    • Details (<details> element)
  • Table of Contents (TOC)
  • Comment parsing

Running on local

  1. Install dependencies
pnpm i
  1. Running server
pnpm run dev

Packages

 
 
 

Contributors