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 60160e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/lib/JSafeHtml.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<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 60160e2

Please sign in to comment.