(() => ({
- template: `${formattedContent.value}
`,
- components: {
- ...components,
- 'x-sharp-file': File,
- 'x-sharp-image': File,
- 'html-content': Html,
- ...Object.fromEntries(
- Object.entries(props.field.embeds ?? {})
- .map(([embedKey, embed]) => [
- embed.tag,
- {
- template: '',
- components: { Embed },
- data: () => ({ embed }),
- }
- ])
- ),
- },
+ const components = computed(() => ({
+ 'x-sharp-file': File,
+ 'x-sharp-image': File,
+ 'html-content': Html,
+ ...Object.fromEntries(
+ Object.entries(props.field.embeds ?? {})
+ .map(([embedKey, embed]) => [
+ embed.tag,
+ {
+ template: '',
+ components: { Embed },
+ data: () => ({ embed }),
+ }
+ ])
+ ),
}));
-
+
-
diff --git a/resources/js/utils/sanitize.ts b/resources/js/utils/sanitize.ts
index 8d21f66bf..f4d0d97bc 100644
--- a/resources/js/utils/sanitize.ts
+++ b/resources/js/utils/sanitize.ts
@@ -6,7 +6,9 @@ export function sanitize(html: string | null) {
ADD_TAGS: ['iframe'],
CUSTOM_ELEMENT_HANDLING: {
tagNameCheck: () => true,
- attributeNameCheck: () => true,
+ attributeNameCheck: (name) => {
+ return !name.match(/^(v-)|:|@|#/); // remove vue related attributes
+ },
},
})
: html;