惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
V
V2EX
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
宝玉的分享
宝玉的分享
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
博客园 - 聂微东
博客园 - 司徒正美
博客园 - 【当耐特】
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
Llmrender
franciscop · 2026-06-13 · via Hacker News: Show HN

A fully featured Markdown renderer for React. From README files to streaming LLM output, one component renders it all:

  • LaTeX rendering for math
  • 30+ languages highlighted
  • Under 12kb, 0 dependencies
  • GitHub Flavored Markdown
  • Streaming-safe rendering
  • 500+ tests, 99.9% coverage
npm install llmrender
# Release 1.0 is available

Now **faster** and ~~heavier~~ lighter. Even $E = mc^2$ renders inline.

$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

You also have **30+ languages** supported in the default Syntax Highlighting:

```jsx
import Markdown from "llmrender";
const App = ({ text }) => <Markdown>{text}</Markdown>;
```

your markdown what your users see

Try it live

Edit the Markdown on the left, or press ▶ stream to watch it render token by token, exactly the way your LLM output arrives.

Syntax highlighting

30+ languages, no highlighter to install

Fenced code blocks come out colored without adding highlight.js or Prism to your bundle. JavaScript, TypeScript, Python, Rust, Go, SQL, CSS, HTML, shell, diff and many more are recognized out of the box.

  • Four ready-made themes: light, dark, adaptive and high-contrast
  • Unknown languages degrade gracefully to plain code blocks
  • Prefer your own stack? Pass any function to the highlight prop and plug in Prism.js in three lines
// Built in, just write Markdown
<Markdown>{text}</Markdown>

// …or bring your own highlighter
<Markdown
  highlight={(code, lang) => (
    <SyntaxHighlighter language={lang}>
      {code}
    </SyntaxHighlighter>
  )}
>

LaTeX math

LaTeX in, native MathML out

LLMs love emitting LaTeX. LLMRender parses it and renders browser-native MathML: fractions, roots, matrices, Greek letters, sums, integrals and accents.

  • Inline $…$ and display $$…$$ syntax
  • Crisp at any zoom level and accessible to screen readers
  • Want KaTeX anyway? Pass it through the math prop and keep everything else
Inline $e^{i\pi} + 1 = 0$ math.

$$
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}
$$

Inline eiπ+1=0 math.

∑ n=1 ∞ 1 n2 = π2 6

GitHub Flavored Markdown

The Markdown everyone actually writes

From READMEs to chat replies, real-world Markdown is GitHub flavored, and LLMRender renders all of it: tables with column alignment, task lists with checkboxes, strikethrough, autolinks, and the [!NOTE]/[!TIP]/[!WARNING] callouts that make documents scannable.

  • Headings get ids and anchor links for deep-linking
  • Nested lists, blockquotes and code inside blockquotes
  • Plus extras like ruby annotations for East-Asian text
> [!WARNING]
> Callouts render with icons and colors.

| Model | Score |
|:------|------:|
| A     |  98.2 |

- [x] Tables, aligned
- [x] Task lists
- [x] ~~Missing features~~

Streaming

Made for tokens arriving mid-sentence

Streaming output means the renderer sees half-finished Markdown hundreds of times per response. LLMRender is designed for that: just re-render with the text you have so far, with no buffering, no flicker, no crashes.

  • Unclosed code fences render as code while they stream
  • Unclosed $$ math blocks render as math
  • Fast enough to re-parse the whole message on every chunk
const [text, setText] = useState("");

for await (const chunk of stream) {
  setText((t) => t + chunk);
}

// Re-render on every chunk: unclosed
// ``` fences and $$ blocks mid-stream
// render gracefully, never break
return <Markdown>{text}</Markdown>;

Security

Safe with untrusted content by default

Whether it comes from users, files or models, Markdown can carry malicious payloads, so LLMRender is safe by default: javascript: and data: URLs are neutralized, raw HTML is ignored unless you opt in, and even then it goes through a strict tag and attribute allowlist.

  • No dangerouslySetInnerHTML anywhere, ever
  • rawHtml blocks scripts, event handlers, iframes and styles even when enabled
  • target="_blank" links get rel="noopener noreferrer" against tabnabbing
// Safe by default: HTML ignored,
// dangerous URLs neutralized
<Markdown>{untrusted}</Markdown>

// Opt in to a safe HTML allowlist
<Markdown rawHtml>{untrusted}</Markdown>

// …or define exactly what's allowed
<Markdown rawHtml={{ b: [], a: ["href"] }}>
  {untrusted}
</Markdown>

Styling

It's just a <div>, style it your way

The output is a plain <div> with semantic HTML inside, so Tailwind Typography, Styled Components, CSS Modules or plain stylesheets all work with zero adapters.

  • Four importable themes: default, dark, adaptive (follows prefers-color-scheme) and contrast (WCAG AAA)
  • Theme colors exposed as --llmrender-* CSS variables
  • Every <div> attribute passes through: className, style, data-*
// Pick a theme…
import "llmrender/themes/adaptive.css";

// …then style it like any other div
<Markdown
  className="prose dark:prose-invert"
  id="answer"
  data-testid="chat-message"
>
  {text}
</Markdown>

Bundle size

A fraction of the usual stack

Markdown + math + highlighting + sanitizing, measured as real bundle overhead in identical Vite builds (methodology):

Package Base Math Highlight Sanitize Full size (gzip)
LLMRender 9 KB built-in built-in built-in 12 KB
react-markdown 33.3 KB +74.6 KB +508 KB built-in 340 KB
marked 12.1 KB +74.6 KB +298 KB +8.7 KB 403 KB
markdown-it 43.3 KB +74.6 KB +298 KB +8.7 KB 436 KB

Install it now

npm install llmrender