Skip to main content
Latest
interface MarkedOptions.MarkedOptions
implements Omit<MarkedExtension,
| "extensions"
| "renderer"
| "tokenizer"
| "walkTokens"
>
import { type MarkedOptions } from "https://deno.land/x/frugal@0.9.6/doc/dep/marked.ts";
const { MarkedOptions } = MarkedOptions;

Properties

optional
renderer: Omit<_Renderer, "constructor"> | undefined | null

Type: object Default: new Renderer()

An object containing functions to render tokens to HTML.

optional
tokenizer: Omit<_Tokenizer, "constructor"> | undefined | null

The tokenizer defines how to turn markdown text into tokens.

optional
walkTokens: ((token: Token) => void | Promise<void> | Array<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.

optional
extensions: (TokenizerAndRendererExtension[] & { renderers: Record<string, RendererExtensionFunction>; childTokens: Record<string, string[]>; block: any[]; inline: any[]; startBlock: Array<(this: TokenizerThis, src: string) => number | void>; startInline: Array<(this: TokenizerThis, src: string) => number | void>; }) | undefined | null

Add tokenizers and renderers to marked

Properties

optional
dryrun: boolean

Generates the next unique slug without updating the internal accumulator.

Properties

lexer: _Lexer

Properties

name: string
level: "block" | "inline"
optional
start: ((this: TokenizerThis, src: string) => number | void) | undefined
tokenizer: (
src: string,
tokens: Token[] | TokensList,
) => Tokens.Generic | undefined
optional
childTokens: string[] | undefined

Properties

parser: _Parser

Properties

optional
async: boolean

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

optional
deprecated
baseUrl: string | undefined | null

A prefix URL for any relative link.

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
deprecated
headerIds: boolean | undefined

Include an id attribute when emitting headings.

optional
deprecated
headerPrefix: string | undefined

Set the prefix for header tag ids.

optional
deprecated
highlight: ((
code: string,
lang: string | undefined,
callback?: (error: Error, code?: string) => void,
) => string | void) | null

A function to highlight code blocks. The function can either be synchronous (returning a string) or asynchronous (callback invoked with an error if any occurred during highlighting and a string if highlighting was successful)

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
deprecated
langPrefix: string | undefined

Set the prefix for code block classes.

optional
deprecated
mangle: boolean | undefined

Mangle autolinks (email@domain.com).

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
deprecated
sanitize: boolean | undefined

Sanitize the output. Ignore any HTML that has been input. If true, sanitize the HTML passed into markdownString with the sanitizer function.

optional
deprecated
sanitizer: ((html: string) => string) | null

Optionally sanitize found HTML with a sanitizer function.

optional
silent: boolean | undefined

Shows an HTML error message when rendering fails.

optional
smartLists: boolean | undefined

Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.

optional
deprecated
smartypants: boolean | undefined

Use "smart" typograhic punctuation for things like quotes and dashes.

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.

optional
deprecated
xhtml: boolean | undefined

Generate closing slash for self-closing tags ( instead of )

Properties

optional
renderer: Omit<_Renderer, "constructor"> | undefined | null

Type: object Default: new Renderer()

An object containing functions to render tokens to HTML.

optional
tokenizer: Omit<_Tokenizer, "constructor"> | undefined | null

The tokenizer defines how to turn markdown text into tokens.

optional
walkTokens: ((token: Token) => void | Promise<void> | Array<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.

optional
extensions: (TokenizerAndRendererExtension[] & { renderers: Record<string, RendererExtensionFunction>; childTokens: Record<string, string[]>; block: any[]; inline: any[]; startBlock: Array<(this: TokenizerThis, src: string) => number | void>; startInline: Array<(this: TokenizerThis, src: string) => number | void>; }) | undefined | null

Add tokenizers and renderers to marked

type alias MarkedOptions.MarkedOptions
import { type MarkedOptions } from "https://deno.land/x/frugal@0.9.6/doc/dep/marked.ts";
const { MarkedOptions } = MarkedOptions;
definition: (this: RendererThis, token: Tokens.Generic) => string | false | undefined