From 5ceff8a6f35afb09d36d3b831b0e593e9a30b4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Sat, 11 Jul 2026 14:32:23 +0200 Subject: [PATCH] feat: use sattery for markdown instead of marked Already used by Astro, use the same for when we need to render markdown content manually (e.g. in API specs). --- package-lock.json | 15 +-------------- package.json | 2 +- src/components/Markdown.astro | 4 ++-- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index c5b37368..350e1a7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,6 @@ "expressive-code": "^0.44.0", "globals": "17.7.0", "jsdom": "^29.1.1", - "marked": "^18.0.5", "openapi-types": "^12.1.3", "prettier": "3.9.4", "prettier-plugin-astro": "^0.14.1", @@ -50,6 +49,7 @@ "react-final-form": "^7.0.1", "rumdl": "0.2.28", "sass": "^1.101.0", + "satteri": "0.9.4", "starlight-links-validator": "^0.25.2", "starlight-llms-txt": "0.11.0", "tsx": "4.23.0", @@ -12301,19 +12301,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/marked": { - "version": "18.0.5", - "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.5.tgz", - "integrity": "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w==", - "dev": true, - "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 20" - } - }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", diff --git a/package.json b/package.json index 431840e3..4ef302b5 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "expressive-code": "^0.44.0", "globals": "17.7.0", "jsdom": "^29.1.1", - "marked": "^18.0.5", "openapi-types": "^12.1.3", "prettier": "3.9.4", "prettier-plugin-astro": "^0.14.1", @@ -96,6 +95,7 @@ "react-final-form": "^7.0.1", "rumdl": "0.2.28", "sass": "^1.101.0", + "satteri": "0.9.4", "starlight-links-validator": "^0.25.2", "starlight-llms-txt": "0.11.0", "tsx": "4.23.0", diff --git a/src/components/Markdown.astro b/src/components/Markdown.astro index cfe0592f..9beeb212 100644 --- a/src/components/Markdown.astro +++ b/src/components/Markdown.astro @@ -1,5 +1,5 @@ --- -import { marked } from "marked"; +import { markdownToHtml } from "satteri"; interface Props { class?: string; @@ -9,7 +9,7 @@ interface Props { const { class: className } = Astro.props; const slot = await Astro.slots.render("default"); -const html = marked.parse(slot); +const { html } = markdownToHtml(slot); ---