Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/gfm/mod.ts>Marked.MarkedOptions.MarkedExtension

Server-side GitHub Flavored Markdown rendering for Deno
Go to Latest
interface Marked.MarkedOptions.MarkedExtension
import { type Marked } from "https://deno.land/x/gfm@0.3.0/mod.ts";
const { MarkedExtension } = Marked.MarkedOptions;

Properties

optional
async: boolean

True will tell marked to await any walkTokens functions before parsing the tokens and returning an HTML string.

optional
breaks: boolean | undefined

Enable GFM line breaks. This option requires the gfm option to be true.

optional
extensions: TokenizerAndRendererExtension[] | undefined | null

Add tokenizers and renderers to marked

optional
gfm: boolean | undefined

Enable GitHub flavored markdown.

optional
hooks: { preprocess: (markdown: string) => string | Promise<string>; postprocess: (html: string) => string | Promise<string>; options?: MarkedOptions; } | null

Hooks are methods that hook into some part of marked. preprocess is called to process markdown before sending it to marked. postprocess is called to process html after marked has finished parsing.

optional
pedantic: boolean | undefined

Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.

optional
renderer: RendererObject | undefined | null

Type: object Default: new Renderer()

An object containing functions to render tokens to HTML.

optional
silent: boolean | undefined

Shows an HTML error message when rendering fails.

optional
tokenizer: TokenizerObject | undefined | null

The tokenizer defines how to turn markdown text into tokens.

optional
walkTokens: ((token: Token) => void | Promise<void>) | undefined | null

The walkTokens function gets called with every token. Child tokens are called before moving on to sibling tokens. Each token is passed by reference so updates are persisted when passed to the parser. The return value of the function is ignored.