Fix html sanitization
This commit is contained in:
parent
fd403ab7ca
commit
4240396220
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { sanitize } from 'dompurify'
|
import DOMPurify from 'dompurify'
|
||||||
import { computed, h } from 'vue'
|
import { computed, h } from 'vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -11,7 +11,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||||
tag: 'div'
|
tag: 'div'
|
||||||
})
|
})
|
||||||
|
|
||||||
const html = computed(() => sanitize(props.html))
|
const html = computed(() => DOMPurify.sanitize(props.html))
|
||||||
const root = () => h(props.tag, { innerHTML: html.value })
|
const root = () => h(props.tag, { innerHTML: html.value })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue