Commit 7aa7efac authored by Takuya Noguchi's avatar Takuya Noguchi

Remove v-html from vue_shared/.../blob_viewers/rich_viewer.vue

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 957bd3bc
<script> <script>
/* eslint-disable vue/no-v-html */ import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import MarkdownFieldView from '~/vue_shared/components/markdown/field_view.vue'; import MarkdownFieldView from '~/vue_shared/components/markdown/field_view.vue';
import ViewerMixin from './mixins'; import ViewerMixin from './mixins';
import { handleBlobRichViewer } from '~/blob/viewer'; import { handleBlobRichViewer } from '~/blob/viewer';
...@@ -8,6 +8,9 @@ export default { ...@@ -8,6 +8,9 @@ export default {
components: { components: {
MarkdownFieldView, MarkdownFieldView,
}, },
directives: {
SafeHtml,
},
mixins: [ViewerMixin], mixins: [ViewerMixin],
mounted() { mounted() {
handleBlobRichViewer(this.$refs.content, this.type); handleBlobRichViewer(this.$refs.content, this.type);
...@@ -15,5 +18,5 @@ export default { ...@@ -15,5 +18,5 @@ export default {
}; };
</script> </script>
<template> <template>
<markdown-field-view ref="content" v-html="content" /> <markdown-field-view ref="content" v-safe-html="content" />
</template> </template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment