Back to browse
LLMRender, a 10kb Markdown+LaTeX renderer for React

LLMRender, a 10kb Markdown+LaTeX renderer for React

by franciscop·Jun 13, 2026·2 points·0 comments

AI Analysis

●●●BangerBig BrainSolve My ProblemCozy

12kb Markdown renderer with zero dependencies when react-markdown bundles 300kb+.

Strengths
  • Zero dependencies with built-in syntax highlighting eliminates external highlight.js or Prism bundles.
  • Streaming-safe by design handles token-by-token LLM output without buffering or flicker.
  • LaTeX renders to native MathML instead of requiring KaTeX, reducing bundle size further.
Weaknesses
  • Regex-based parsing admits limitations compared to proper AST parsers for edge cases.
  • No HTML support by default may break existing Markdown with embedded HTML content.
Target Audience

React developers building LLM chat interfaces or documentation sites

Similar To

react-markdown · remark · markdown-it

Post Description

I've been using the popular React Markdown renderers with Katex and Prism.js for rendering my Markdown and LaTeX, but was tired of having to bundle 300kb+ of min+gzip JS only for this (1.2MB+ of plain JS!). So I created a small Markdown renderer that does it all in a tiny package.

I added a small playground to the homepage, please feel free to try it and let me know what you think!

It's not perfect, it's definitely not "correct" in that I'm using Regex internally instead of a proper AST parser, but for my usecase and the majority of Markdown out there, this works perfectly fine (cue the StackOverflow post [1]). It's also conservative for this reason; no HTML by default, parsing wrong content produces escaped HTML entities instead of XSS.

[1] https://stackoverflow.com/a/1732454

Similar Projects