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

x/fresh/www/utils/markdown.ts>gfm.Marked.Marked

The next-gen web framework.
Extremely Popular
Go to Latest
namespace gfm.Marked.Marked
import { gfm } from "https://deno.land/x/fresh@1.4.3/www/utils/markdown.ts";
const { Marked } = gfm.Marked;
class gfm.Marked.Marked
import { gfm } from "https://deno.land/x/fresh@1.4.3/www/utils/markdown.ts";
const { Marked } = gfm.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 gfm.Marked.Marked
import { gfm } from "https://deno.land/x/fresh@1.4.3/www/utils/markdown.ts";
const { Marked } = gfm.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