Commit 7643482c authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch...

Merge branch '241925-remove-v-html-from-app-assets-javascripts-vue_shared-components-blob_viewers-rich_viewer-vue' into 'master'

Remove v-html from app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue

Closes #241925

See merge request gitlab-org/gitlab!41509
parents 4d49fa22 7aa7efac
<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