Flattens the Markdown users write into one line of plain text, where a quote of it can't render markup: the chat's reply previews, the digest email's quotes of a comment or a note, and the line of a description on a playlist's card and on a user in the search results.

Functions

f
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.