Skip to content

Commit 1135e47

Browse files
authored
fix: render markdown in custom page redirect messages (calcom#25987)
Before:- <img width="1986" height="762" alt="image (26)" src="https://github.com/user-attachments/assets/90e16a5c-a8f1-4269-8873-8854a82c012e" /> <img width="3456" height="2068" alt="image (27)" src="https://github.com/user-attachments/assets/6714a1d5-454d-4fe7-b6ce-84120353a10a" /> After:- <img width="977" height="456" alt="Screenshot 2025-12-17 at 9 09 22 PM" src="https://github.com/user-attachments/assets/449611ab-8d84-41e2-a342-0e334562cec5" />
1 parent 68e670a commit 1135e47

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/web/app/(use-page-wrapper)/apps/routing-forms/[...pages]/RoutingLink.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import useGetBrandingColours from "@calcom/lib/getBrandColours";
1919
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";
2020
import { useLocale } from "@calcom/lib/hooks/useLocale";
2121
import useTheme from "@calcom/lib/hooks/useTheme";
22+
import { markdownToSafeHTMLClient } from "@calcom/lib/markdownToSafeHTMLClient";
2223
import { navigateInTopWindow } from "@calcom/lib/navigateInTopWindow";
2324
import { trpc } from "@calcom/trpc/react";
2425
import type { inferSSRProps } from "@calcom/types/inferSSRProps";
@@ -208,7 +209,10 @@ function RoutingForm({ form, profile, ...restProps }: Props) {
208209
<div className="mx-auto my-0 max-w-3xl md:my-24">
209210
<div className="w-full max-w-4xl ltr:mr-2 rtl:ml-2">
210211
<div className="main sm:border-subtle bg-default -mx-4 rounded-md border border-neutral-200 p-4 py-6 sm:mx-0 sm:px-8">
211-
<div className="text-emphasis">{customPageMessage}</div>
212+
<div
213+
className="text-emphasis prose prose-sm dark:prose-invert max-w-none"
214+
dangerouslySetInnerHTML={{ __html: markdownToSafeHTMLClient(customPageMessage) }}
215+
/>
212216
</div>
213217
</div>
214218
</div>

apps/web/pages/router/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import Head from "next/head";
44

5+
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
56
import type { inferSSRProps } from "@calcom/types/inferSSRProps";
67

78
import PageWrapper from "@components/PageWrapper";
@@ -17,7 +18,12 @@ export default function Router({ form, message, errorMessage }: inferSSRProps<ty
1718
<div className="mx-auto my-0 max-w-3xl md:my-24">
1819
<div className="w-full max-w-4xl ltr:mr-2 rtl:ml-2">
1920
<div className="text-default bg-default -mx-4 rounded-sm border border-neutral-200 p-4 py-6 sm:mx-0 sm:px-8">
20-
<div>{message || errorMessage}</div>
21+
<div
22+
className="prose prose-sm dark:prose-invert max-w-none"
23+
dangerouslySetInnerHTML={{
24+
__html: markdownToSafeHTML(message || errorMessage),
25+
}}
26+
/>
2127
</div>
2228
</div>
2329
</div>

0 commit comments

Comments
 (0)