diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2026-01-13 19:06:55 +0100 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2026-01-13 19:06:55 +0100 |
| commit | 42662ae3db2a2f2366942ab7d68f9441e03b29bb (patch) | |
| tree | cbeea04301500f180fc1c6973e3d7222469e5f45 /src/utils/markdown.ts | |
| parent | c4afcab46587ace0a9f3b22592f6d17c62ff9e0e (diff) | |
Add full content render for rss feed
Diffstat (limited to 'src/utils/markdown.ts')
| -rw-r--r-- | src/utils/markdown.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/markdown.ts b/src/utils/markdown.ts new file mode 100644 index 0000000..946d8d8 --- /dev/null +++ b/src/utils/markdown.ts @@ -0,0 +1,11 @@ +import { marked } from "marked"; + +marked.setOptions({ + breaks: true, + gfm: true, +}); + +export function markdownToHtml(markdown: string): string { + const html = marked.parse(markdown); + return typeof html === "string" ? html : ""; +} |
