BLOG-72 Fix img cannot be shown on content page (#74)
All checks were successful
Frontend CI / build (push) Successful in 1m7s
All checks were successful
Frontend CI / build (push) Successful in 1m7s
### Description <https://www.npmjs.com/package/sanitize-html>  ### Package Changes _No response_ ### Screenshots _No response_ ### Reference Resolves #72 ### Checklist - [x] A milestone is set - [x] The related issuse has been linked to this branch Reviewed-on: #74 Co-authored-by: SquidSpirit <squid@squidspirit.com> Co-committed-by: SquidSpirit <squid@squidspirit.com>
This commit is contained in:
parent
2039edf5e9
commit
7770a5b569
@ -5,7 +5,9 @@
|
||||
|
||||
const { html }: { html: string } = $props();
|
||||
|
||||
const sanitizedHtml = $derived(sanitizeHtml(html));
|
||||
const sanitizedHtml = $derived(
|
||||
sanitizeHtml(html, { allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img']) })
|
||||
);
|
||||
</script>
|
||||
|
||||
{@html sanitizedHtml}
|
||||
|
Loading…
x
Reference in New Issue
Block a user