function renderMarkdown
renderMarkdown(
text: string,
imageUrls?: ReadonlyMap<number, string>,
): string

Renders block markdown, escaping raw HTML and stripping unsafe URLs. An img#N reference resolves through imageUrls. Without the argument, it resolves through the request's page-image slot, which the page's loaders fill with addPageImageUrls (see #db/image-urls.ts). A missing entry renders no image, and the alt text shows. The override exists for a render whose table is not the page's, such as the site footer.

Parameters

text: string
optional
imageUrls: ReadonlyMap<number, string>

Return Type

string

Usage

import { renderMarkdown } from "doc.ts";