Skip to content

Commit f3fa3f2

Browse files
authored
fix: render md in snippet descriptions (#26426)
1 parent 4106ec1 commit f3fa3f2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/ResourcesBySelector.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ReactSelect from "./ReactSelect";
55
import { formatDistance } from "date-fns";
66
import { setSearchParams } from "~/util/url";
77
import { formatContentType } from "~/util/content-type";
8+
import Markdown from "react-markdown";
89

910
type DocsData = keyof CollectionEntry<"docs">["data"];
1011
type VideosData = keyof CollectionEntry<"stream">["data"];
@@ -367,7 +368,12 @@ export default function ResourcesBySelector({
367368
</p>
368369
{showDescriptions && (
369370
<span className="line-clamp-3" title={page.data.description}>
370-
{page.data.description}
371+
<Markdown
372+
disallowedElements={["a"]}
373+
unwrapDisallowed={true}
374+
>
375+
{page.data.description}
376+
</Markdown>
371377
</span>
372378
)}
373379
{showLastUpdated && "reviewed" in page.data && (

0 commit comments

Comments
 (0)