1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-22 06:39:41 +02:00

fix: allow-iframe-embeds (#2009)

* allow embedding iframes

* fix alignment issue for buttons
This commit is contained in:
Hayden 2023-01-08 10:50:26 -08:00 committed by GitHub
parent 61ccaded2c
commit ae59f04b9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -20,17 +20,19 @@ export default defineComponent({
},
setup() {
function sanitizeMarkdown(rawHtml: string | null | undefined): string {
console.log(rawHtml)
if (!rawHtml) {
return "";
}
const sanitized = DOMPurify.sanitize(rawHtml, {
USE_PROFILES: { html: true },
// TODO: some more thought could be put into what is allowed and what isn't
ALLOWED_TAGS: ["img", "div", "p"],
ADD_ATTR: ["src", "alt", "height", "width", "class"],
ALLOWED_TAGS: ["img", "div", "p", "iframe"],
ADD_ATTR: ["src", "alt", "height", "width", "class", "allow", "title", "allowfullscreen", "frameborder", "scrolling"],
});
console.log(sanitized)
return sanitized;
}