function rewriteImageDestinations
rewriteImageDestinations(
markdown: string,
toUrl: ImageDestination,
): string

Rewrites each picture reference's address through toUrl, and keeps every other byte of the source. A reference-style picture the table resolves takes the editor's inline form, and its definition's address resolves with it. The lexer parses code spans and fenced code blocks as code, not as pictures. A reference inside them keeps the form the author wrote, the way the HTML render shows it. A reference whose address toUrl leaves undefined keeps its written form too.

Parameters

markdown: string
toUrl: ImageDestination

Return Type

string

Usage

import { rewriteImageDestinations } from "docs/utilities.ts";