support html img in wpt desc

This commit is contained in:
vcoppe
2024-08-14 18:19:28 +02:00
parent f36194b336
commit 9327870d54

View File

@@ -24,13 +24,13 @@
if (text === undefined) { if (text === undefined) {
return ''; return '';
} }
let sanitized = sanitizeHtml(text, { return sanitizeHtml(text, {
allowedTags: ['a', 'br'], allowedTags: ['a', 'br', 'img'],
allowedAttributes: { allowedAttributes: {
a: ['href', 'target'] a: ['href', 'target'],
img: ['src']
} }
}).trim(); }).trim();
return sanitized;
} }
</script> </script>
@@ -102,4 +102,9 @@
@apply text-blue-500 dark:text-blue-300; @apply text-blue-500 dark:text-blue-300;
@apply hover:underline; @apply hover:underline;
} }
div :global(img) {
@apply my-0;
@apply rounded-md;
}
</style> </style>