From 168a5fdf1c066809e9989bf22b291d0bd0eda3ef Mon Sep 17 00:00:00 2001 From: Kevin_Ramirez Date: Mon, 23 Feb 2026 10:57:12 -0600 Subject: [PATCH] Cambios desde el servidor cliente --- .../routes/dashboard/help-center/[uuid]/+page.svelte | 7 ++++++- .../dashboard/help-center/editor/[uuid]/+page.svelte | 10 ++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/routes/dashboard/help-center/[uuid]/+page.svelte b/frontend/src/routes/dashboard/help-center/[uuid]/+page.svelte index 07f6a6e6..66a799b4 100644 --- a/frontend/src/routes/dashboard/help-center/[uuid]/+page.svelte +++ b/frontend/src/routes/dashboard/help-center/[uuid]/+page.svelte @@ -48,6 +48,8 @@ }); } + import { browser } from '$app/environment'; + function renderMarkdown(content: string) { const rawHtml = marked.parse(content || '') as string; // Add IDs to headers for TOC navigation @@ -55,7 +57,10 @@ const id = text.toLowerCase().replace(/[^\w]+/g, '-'); return `${text}`; }); - return DOMPurify.sanitize(htmlWithIds); + if (browser) { + return DOMPurify.sanitize(htmlWithIds); + } + return htmlWithIds; } function scrollToHeader(id: string) { diff --git a/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte b/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte index 7eeec691..a098954a 100644 --- a/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte +++ b/frontend/src/routes/dashboard/help-center/editor/[uuid]/+page.svelte @@ -139,15 +139,9 @@ } } + import { browser } from '$app/environment'; + function renderMarkdown(text: string) { - if (!browser) { - // Basic fallback for SSR to avoid crashing - return (text || '') - .replace(/^# (.*$)/gim, '

$1

') - .replace(/^## (.*$)/gim, '

$1

') - .replace(/\*\*(.*)\*\*/gim, '$1') - .replace(/\n/gim, '
'); - } // @ts-ignore return DOMPurify.sanitize(marked.parse(text || '') as string); }