Commit 03140464 authored by Rishabh Gupta's avatar Rishabh Gupta Committed by Ezekiel Kigbo

Replace v-html with v-safe-html in the release block component

parent f746aadb
<script> <script>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import $ from 'jquery'; import $ from 'jquery';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { scrollToElement } from '~/lib/utils/common_utils'; import { scrollToElement } from '~/lib/utils/common_utils';
...@@ -21,6 +22,9 @@ export default { ...@@ -21,6 +22,9 @@ export default {
ReleaseBlockHeader, ReleaseBlockHeader,
ReleaseBlockMilestoneInfo, ReleaseBlockMilestoneInfo,
}, },
directives: {
SafeHtml,
},
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
release: { release: {
...@@ -79,6 +83,7 @@ export default { ...@@ -79,6 +83,7 @@ export default {
$(this.$refs['gfm-content']).renderGFM(); $(this.$refs['gfm-content']).renderGFM();
}, },
}, },
safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] },
}; };
</script> </script>
<template> <template>
...@@ -102,10 +107,7 @@ export default { ...@@ -102,10 +107,7 @@ export default {
<evidence-block v-if="hasEvidence" :release="release" /> <evidence-block v-if="hasEvidence" :release="release" />
<div ref="gfm-content" class="card-text gl-mt-3"> <div ref="gfm-content" class="card-text gl-mt-3">
<div <div v-safe-html:[$options.safeHtmlConfig]="release.descriptionHtml" class="md"></div>
class="md"
v-html="release.descriptionHtml /* eslint-disable-line vue/no-v-html */"
></div>
</div> </div>
</div> </div>
......
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