diff options
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]; |
