function markdownToPlainText
markdownToPlainText(
md: string,
imageLabel: string
): string

Returns the Markdown md as one line of plain text. Images become their alt text, or imageLabel without one, and links their text. It also takes a body cut short, possibly inside a link, as the server cuts a chat message's replyToBody: the unfinished link then shows as its text, without half a URL.

Parameters

md: string
imageLabel: string

Return Type

string

Usage

import { markdownToPlainText } from "shared/markdown.ts";