Skip to content

Commit

Permalink
refactor(JSafeHtml): use createVNode
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed Jun 22, 2024
1 parent 6cf9bbd commit e1820bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/lib/JSafeHtml.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { h } from 'vue';
import { Static, createVNode, h } from 'vue';
import { sanitizeHtml } from '@/utils/html';
interface Props {
html: string;
markdown?: boolean;
}
const JSafeHtml = (props: Props) => h('j-safe-html', { innerHTML: sanitizeHtml(props.html, props.markdown) });
const JSafeHtml = (props: Props) => h(createVNode(Static, undefined, sanitizeHtml(props.html, Boolean(props.markdown))), { key: props.html });
JSafeHtml.inheritAttrs = false;
Expand Down

0 comments on commit e1820bf

Please sign in to comment.