diff --git a/apps/web/pages/[user]/[type].tsx b/apps/web/pages/[user]/[type].tsx index 398e8e8c18..01102656e8 100644 --- a/apps/web/pages/[user]/[type].tsx +++ b/apps/web/pages/[user]/[type].tsx @@ -1,3 +1,4 @@ +import MarkdownIt from "markdown-it"; import { GetStaticPaths, GetStaticPropsContext } from "next"; import { JSONObject } from "superjson/dist/types"; import { z } from "zod"; @@ -112,6 +113,14 @@ async function getUserPageProps(context: GetStaticPropsContext) { }, }); + const md = new MarkdownIt("zero").enable([ + // + "emphasis", + "list", + "newline", + "strikethrough", + ]); + if (!user || !user.eventTypes) return { notFound: true }; const [eventType]: (typeof user.eventTypes[number] & { @@ -139,6 +148,7 @@ async function getUserPageProps(context: GetStaticPropsContext) { metadata: EventTypeMetaDataSchema.parse(eventType.metadata || {}), recurringEvent: parseRecurringEvent(eventType.recurringEvent), locations: privacyFilteredLocations(locations), + descriptionAsSafeHTML: eventType.description ? md.render(eventType.description) : null, }); return {