diff --git a/packages/ui/src/custom/org-landing-page/embed.svelte b/packages/ui/src/custom/org-landing-page/embed.svelte index 7032bb6a..0475451f 100644 --- a/packages/ui/src/custom/org-landing-page/embed.svelte +++ b/packages/ui/src/custom/org-landing-page/embed.svelte @@ -2,7 +2,7 @@ import type { OrgLandingPageLabels, OrgLandingPageTheme, LandingPageEmbed } from './types'; import SecondaryActionButton from './secondary-action-button.svelte'; import EditableLandingSection from './editable-section.svelte'; - import SafeHtmlContent from '../safe-html-content/safe-html-content.svelte'; + import { sanitizeEmbedHtml } from '../../tools/sanitize'; let { embed, @@ -52,7 +52,7 @@ style="border: 1px solid #262a35; background: #0f1218; box-shadow: 0 30px 90px -30px rgba(0,0,0,0.7);" >
- + {@html sanitizeEmbedHtml(embed.code)}
{/if} @@ -77,7 +77,7 @@ {/if} {#if embed.code}
- + {@html sanitizeEmbedHtml(embed.code)}
{/if} @@ -96,7 +96,7 @@ {/if} {#if embed.code}
- + {@html sanitizeEmbedHtml(embed.code)}
{/if} diff --git a/packages/ui/src/tools/sanitize.ts b/packages/ui/src/tools/sanitize.ts index 145af02f..9c02a426 100644 --- a/packages/ui/src/tools/sanitize.ts +++ b/packages/ui/src/tools/sanitize.ts @@ -133,6 +133,34 @@ export function splitHtmlAndSvg(html: string): ContentSegment[] { return segments; } +/** + * Sanitizes an embed code snippet (e.g. a pasted