jill64 / svelte-sanitize

💎 Safe html expansion for Svelte with universal-sanitize
https://svelte-sanitize.jill64.dev
MIT License
3 stars 0 forks source link

DOMPurify Hooks #426

Open EskelCz opened 1 month ago

EskelCz commented 1 month ago

Hi, thanks for a great tool.

I've run into an issue I don't know how to solve. I need to allow youtube embeds (iframe, but only from youtube.com), which doesn't seem to be solvable only through DOMPurify options object. I think I need hooks. Is there a way to use them through svelte-sanitize?

Thanks

jill64 commented 1 month ago

Thanks for opening this Issue!

New hook function option with DOMPurify object as argument is available in v1.3.0. This function will be executed before sanitize. Please check if this solves your problem. See universal-sanitizer README for a detailed usage example.