summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2026-01-13 19:06:55 +0100
committerDawid Rycerz <dawid@rycerz.xyz>2026-01-13 19:06:55 +0100
commit42662ae3db2a2f2366942ab7d68f9441e03b29bb (patch)
treecbeea04301500f180fc1c6973e3d7222469e5f45 /src/utils
parentc4afcab46587ace0a9f3b22592f6d17c62ff9e0e (diff)
Add full content render for rss feed
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/markdown.ts11
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 : "";
+}