(content: string)
| 14 | * 渲染 Markdown 为 HTML |
| 15 | */ |
| 16 | export function renderMarkdown(content: string): string { |
| 17 | try { |
| 18 | return marked.parse(content) as string; |
| 19 | } catch (error) { |
| 20 | console.error("Markdown render error:", error); |
| 21 | return content; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * 提取纯文本(去除 Markdown 标记) |