// Rough plain-text version of Markdown for compact previews in the editor. export function stripMarkdown(markdown: string): string { return markdown .replace(/\[([^\]]*)\]\([^)]*\)/g, "$1") .replace(/^\s*(#{1,6}|>|[-*+]|\d+\.)\s+/gm, "") .replace(/[*_`~]/g, "") .replace(/\s+/g, " ") .trim(); }