View as Markdown

API reference: @salmonui/rich-text

embedAllowedfunction

import { embedAllowed } from '@salmonui/rich-text';
function embedAllowed(src: string, embedHosts: readonly string[]): boolean;

Whether an iframe src points at an allowed embed host. embedHosts entries are exact hostnames (www.youtube-nocookie.com) or *.example.com for any subdomain of example.com. Only http(s) URLs with no credentials and no backslashes qualify.