twitchdown
v1.7.1
Published
Dead simple Markdown parser for react-like libraries
Downloads
44
Maintainers
Readme
twitchdown
Dead simple Markdown parser for react-like libraries
Kudos
Kudos goes to Jason Miller and the contributors to Snarkdown as this is based off their hard work.
Features
- Still fast
- Still small (7.2kB, 3kB gzipped CJS, 6.8kB, 2.7kB ESM)
- Typed
- Still simply - pass a Markdown string, get an array of components (created with the given
createElementfunction) - Supports description lists
- Option to use custom
{@ }tags and handlers - Option to add
<p>tags around text - Option to replace
--,---and...with an endash, emdash and ellipsis respectively - Integrate with code highlighters like react-syntax-highlighter
- Minified CJS version included
Limitations
As twitchdown uses regular expressions for parsing, it is limited in the formatting that it can handle. Although most good practices should be handled correctly, here are some formatting issues that aren't
- lists with paragraphs
- item - item with a paragraph break - item - items where line continuations aren't indented
- item - item continued item - item - items without spacing between the point and the text
- item -item - item
Example
For a more "real life" example with lazy loading, see the Markdown component of MARSS
