Skip to main content
Module

x/lunchbox/src/markdown.ts>Marked.Marked

Component Library 🍱 for Deno πŸ¦• Fresh πŸ‹
Go to Latest
namespace Marked.Marked
import { Marked } from "https://deno.land/x/lunchbox@v0.3.15/src/markdown.ts";
const { Marked } = Marked;
class Marked.Marked
import { Marked } from "https://deno.land/x/lunchbox@v0.3.15/src/markdown.ts";
const { Marked } = Marked;

Constructors

new
Marked(...extensions: marked.MarkedExtension[])

Methods

getDefaults(): marked.MarkedOptions

Gets the original marked default options.

parse(src: string, callback: (error: any, parseResult: string) => void): void

Compiles markdown to HTML.

parse(src: string, options: marked.MarkedOptions & { async: true; }): Promise<string>

Compiles markdown to HTML asynchronously.

parse(src: string, options?: marked.MarkedOptions): string

Compiles markdown to HTML synchronously.

parse(
src: string,
options: marked.MarkedOptions,
callback: (error: any, parseResult: string) => void,
): void

Compiles markdown to HTML synchronously.

parseInline(src: string, options?: marked.MarkedOptions): string

Compiles markdown to HTML without enclosing p tag.

setOptions(options: marked.MarkedOptions): Marked

Sets the default options.

use(...extensions: marked.MarkedExtension[]): void

Use Extension

walkTokens(tokens: marked.Token[] | marked.TokensList, callback: (token: marked.Token) => void): Marked

Type Parameters

optional
T = never

Type Parameters

optional
T = never

Constructors

new
Marked(...extensions: marked.MarkedExtension[])

Methods

getDefaults(): marked.MarkedOptions

Gets the original marked default options.

parse(src: string, callback: (error: any, parseResult: string) => void): void

Compiles markdown to HTML.

parse(src: string, options: marked.MarkedOptions & { async: true; }): Promise<string>

Compiles markdown to HTML asynchronously.

parse(src: string, options?: marked.MarkedOptions): string

Compiles markdown to HTML synchronously.

parse(
src: string,
options: marked.MarkedOptions,
callback: (error: any, parseResult: string) => void,
): void

Compiles markdown to HTML synchronously.

parseInline(src: string, options?: marked.MarkedOptions): string

Compiles markdown to HTML without enclosing p tag.

setOptions(options: marked.MarkedOptions): Marked

Sets the default options.

use(...extensions: marked.MarkedExtension[]): void

Use Extension

walkTokens(tokens: marked.Token[] | marked.TokensList, callback: (token: marked.Token) => void): Marked
function Marked.Marked
import { Marked } from "https://deno.land/x/lunchbox@v0.3.15/src/markdown.ts";
const { Marked } = Marked;

Compiles markdown to HTML asynchronously.

Parameters

src: string

String of markdown source to be compiled

options: marked.MarkedOptions & { async: true; }

Hash of options, having async: true

Returns

Promise<string>

Promise of string of compiled HTML

Compiles markdown to HTML synchronously.

Parameters

src: string

String of markdown source to be compiled

optional
options: marked.MarkedOptions

Optional hash of options

Returns

string

String of compiled HTML

Compiles markdown to HTML asynchronously with a callback.

Parameters

src: string

String of markdown source to be compiled

callback: (error: any, parseResult: string) => void

Function called when the markdownString has been fully parsed when using async highlighting

Compiles markdown to HTML asynchronously with a callback.

Parameters

src: string

String of markdown source to be compiled

options: marked.MarkedOptions

Hash of options

callback: (error: any, parseResult: string) => void

Function called when the markdownString has been fully parsed when using async highlighting