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/loaders/pleroma.ts | |
| parent | c4afcab46587ace0a9f3b22592f6d17c62ff9e0e (diff) | |
Add full content render for rss feed
Diffstat (limited to 'src/loaders/pleroma.ts')
| -rw-r--r-- | src/loaders/pleroma.ts | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/loaders/pleroma.ts b/src/loaders/pleroma.ts index 36ea4d6..83f60c2 100644 --- a/src/loaders/pleroma.ts +++ b/src/loaders/pleroma.ts @@ -1,6 +1,6 @@ import type { Loader } from "astro/loaders"; -import { marked } from "marked"; import TurndownService from "turndown"; +import { markdownToHtml } from "@/utils/markdown"; interface Logger { info: (message: string) => void; @@ -606,20 +606,6 @@ function replacePleromaLinks( return modifiedContent; } -function markdownToHtml(markdown: string): string { - // Configure marked options for safe rendering - marked.setOptions({ - breaks: true, // Convert line breaks to <br> - gfm: true, // GitHub flavored markdown - }); - - // Convert markdown to HTML - const html = marked.parse(markdown); - - // Return as string (marked.parse can return string or Promise<string>) - return typeof html === "string" ? html : ""; -} - function extractTitle(content: string): string { // Extract first line or first sentence as title const firstLine = content.split("\n")[0]; |
