Use snarkdown-loader for Webpack
mainsnarkdown-loader to automatically render Markdown files into HTML during your build process.repository·main·Indexed 25 days ago
https://github.com/developit/snarkdownA tiny (1kb), fast Markdown parser that transforms Markdown strings into HTML strings. Designed for minimal use-cases and constrained environments, it supports common syntax including headings, code blocks, lists, and inline formatting, though it does not support tables or HTML sanitization.
snarkdown-loader to automatically render Markdown files into HTML during your build process.Snarkdown is a minimal, 1kb Markdown parser designed for constrained environments. It works by taking a Markdown string as input and returning an HTML string as output.
Important Security Note: Snarkdown does not sanitize HTML. It is intended for use cases where XSS protection is handled elsewhere or is not required.
Limitations: Tables are not currently supported.
import snarkdown from 'snarkdown';
let md = '_this_ is **easy** to `use`.';
let html = snarkdown(md);
console.log(html);
// <em>this</em> is <strong>easy</strong> to <code>use</code>.snarkdown module exports a single function. When called with a Markdown string, it returns the corresponding HTML string. It is available in multiple module formats including ES Modules, CommonJS, and UMD.The parse function is the primary entry point for snarkdown. It converts a Markdown string into an HTML string. It supports common Markdown syntax including headings, code blocks, lists, blockquotes, images, links, and inline formatting (em, strong, strike, etc.).
Parameters:
md (String): The Markdown content to be parsed.prevLinks (Object, optional): An object containing previously defined link references. This allows for incremental parsing or maintaining link state across multiple calls.Returns: