import { marked } from 'marked';
/**
 * Converts markdown text to plain text
 * @param markdown The markdown text to convert
 * @returns Plain text
 */
const markdownToPlainText = (markdown) => {
    if (!markdown)
        return '';
    // Convert Markdown to HTML
    const html = marked(markdown);
    // Use DOMParser to convert HTML to plain text
    const parser = new DOMParser();
    const doc = parser.parseFromString(html, 'text/html');
    return doc.body.textContent?.trim() ?? '';
};
export default markdownToPlainText;
//# sourceMappingURL=markdownToPlainText.js.map