Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score100%
Downloads1/wk
Publisheda year ago (0.4.4)

High-speed spec-compliant Markdown parser and renderer written in Rust and compiled to WASM. Powered by the comrak crate under the hood. Supported everywhere.

Functions

f
markdownToHTML(
markdown: string,
options?: ComrakOptions
): string

Render Markdown to HTML.

Interfaces

I

Options to select extensions.

I

Options for the markdownToHTML function.

  • extension: ComrakExtensionOptions

    Enable CommonMark extensions.

  • parse: ComrakParseOptions

    Configure parse-time options.

  • render: ComrakRenderOptions

    Configure render-time options.

I

Options for parser functions.

  • defaultInfoString: string | null

    The default info string for fenced code blocks.

  • Whether or not a simple x or X is used for tasklist or any other symbol is allowed.

  • smart: boolean

    Punctuation (quotes, full-stops and hyphens) are converted into ‘smart’ punctuation.

I

Options for formatter functions.

  • escape: boolean

    Escape raw HTML instead of clobbering it.

  • Whether to use the full info string for fenced code blocks.

  • githubPreLang: boolean

    GitHub-style <pre lang="xyz"> is used for fenced code blocks with info tags.

  • hardbreaks: boolean

    Soft line breaks in the input translate into hard line breaks in the output.

  • listStyle: "dash" | "plus" | "star"

    The style for list items.

  • unsafe: boolean

    Allow rendering of raw HTML and potentially dangerous links.

  • width: number

    The wrap column when outputting CommonMark.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@nick/comrak

Import symbol

import * as mod from "@nick/comrak";
or

Import directly with a jsr specifier

import * as mod from "jsr:@nick/comrak";