12 lines
208 B
TypeScript
12 lines
208 B
TypeScript
import { marked } from 'marked';
|
|
|
|
marked.setOptions({
|
|
breaks: true,
|
|
gfm: true,
|
|
});
|
|
|
|
export function renderMarkdown(text: string): string {
|
|
if (!text) return '';
|
|
return marked.parse(text) as string;
|
|
}
|