Skip to main content
Home

Built and signed on GitHub Actions

🖨️ Render markdown to HTML using the unified ecosystem.

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 Score
94%
Published
2 months ago (2.0.3)

🖨️ Markdown

JSR JSR Score NPM Coverage

📑 Examples

Rendering markdown

// Render markdown using the default renderer
import { Renderer } from "./renderer.ts"
await Renderer.render("# Hello, world!")

// Render markdown using a custom renderer
import { gfm, highlighting, markers, math, sanitize, wikilinks } from "./plugins/mod.ts"
const renderer = new Renderer({ plugins: [gfm, highlighting, math, markers, wikilinks, sanitize] })
await renderer.render("# Hello, world!")

Creating a custom renderer with different plugins sources

import { Renderer } from "./renderer.ts"
import frontmatter from "./plugins/frontmatter.ts"

const renderer = await Renderer.with({
  plugins: [
    // You can specify an existing Plugin object...
    frontmatter,
    // ...or a a HTTPS import that points towards a compatible Plugin object!
    // Warning: this is not possible if you are using the JSR package version
    //          https://github.com/denoland/deno/pull/22623
    "https://esm.sh/jsr/@libs/markdown/plugins/gfm",
  ],
})
await renderer.render("# foo")

✨ Features

📜 Licenses and credits

Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE

This library rely on the awesome unified ecosystem.

Built and signed on
GitHub Actions

New Ticket: 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:@libs/markdown

Import symbol

import * as markdown from "@libs/markdown";
or

Import directly with a jsr specifier

import * as markdown from "jsr:@libs/markdown";

Add Package

pnpm i jsr:@libs/markdown
or (using pnpm 10.8 or older)
pnpm dlx jsr add @libs/markdown

Import symbol

import * as markdown from "@libs/markdown";

Add Package

yarn add jsr:@libs/markdown
or (using Yarn 4.8 or older)
yarn dlx jsr add @libs/markdown

Import symbol

import * as markdown from "@libs/markdown";

Add Package

vlt install jsr:@libs/markdown

Import symbol

import * as markdown from "@libs/markdown";

Add Package

npx jsr add @libs/markdown

Import symbol

import * as markdown from "@libs/markdown";

Add Package

bunx jsr add @libs/markdown

Import symbol

import * as markdown from "@libs/markdown";