BLOG-72 fix: allow img tag to sanitizeHtml
All checks were successful
Frontend CI / build (push) Successful in 1m11s
PR Title Check / pr-title-check (pull_request) Successful in 16s

This commit is contained in:
SquidSpirit 2025-07-26 00:28:35 +08:00
parent 2039edf5e9
commit dc052c1927

View File

@ -5,7 +5,9 @@
const { html }: { html: string } = $props(); const { html }: { html: string } = $props();
const sanitizedHtml = $derived(sanitizeHtml(html)); const sanitizedHtml = $derived(
sanitizeHtml(html, { allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']) })
);
</script> </script>
{@html sanitizedHtml} {@html sanitizedHtml}