htmdown is an MDX-like syntax library for plain JavaScript using tagged template literals, built on top of htm. Current stable version is 0.1.0. It allows embedding JSX-like expressions in Markdown without a transpiler, leveraging the htm library for template-based virtual DOM creation. It ships TypeScript definitions. Key differentiators: no build step, works with React and Preact, and uses standard ES6 template literals. Released at a low cadence, it is a minimal utility for small projects or prototypes.
npm install htmdownNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using htmdown with React: binding to createElement, embedding expressions, and rendering with React DOM.
Call const md = htmdown.bind(React.createElement); before using md`...`.
Run npm i htm alongside htmdown.
Use <br/> instead of <br> inside template literals.
Wrap multiple elements in a single parent, e.g., div or fragment.
Use the syntax normally; it's by design.
Ensure you use import (not require) and bind to a createElement: const md = htmdown.bind(React.createElement);
Run: npm install htm
Always self-close void elements: <img src='...' />