Commit 0ac2f3df authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'imrishabh18-#241934' into 'master'

refactor: replacing v-html with v-safe-html in the snippet description view component

See merge request gitlab-org/gitlab!70828
parents 63bf35e0 ff8ad056
<script> <script>
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';
export default { export default {
components: { components: {
MarkdownFieldView, MarkdownFieldView,
}, },
directives: {
SafeHtml,
},
props: { props: {
description: { description: {
type: String, type: String,
...@@ -12,13 +16,14 @@ export default { ...@@ -12,13 +16,14 @@ export default {
default: '', default: '',
}, },
}, },
safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
}; };
</script> </script>
<template> <template>
<markdown-field-view class="snippet-description" data-qa-selector="snippet_description_content"> <markdown-field-view class="snippet-description" data-qa-selector="snippet_description_content">
<div <div
v-safe-html:[$options.safeHtmlConfig]="description"
class="md js-snippet-description" class="md js-snippet-description"
v-html="description /* eslint-disable-line vue/no-v-html */"
></div> ></div>
</markdown-field-view> </markdown-field-view>
</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