Commit 1354564a authored by Kev's avatar Kev

Replace v-html with v-safe-html in noteable_note.vue

parent 2d4d8022
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import $ from 'jquery'; import $ from 'jquery';
import { mapGetters, mapActions } from 'vuex'; import { mapGetters, mapActions } from 'vuex';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlSprintf } from '@gitlab/ui'; import { GlSprintf, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
...@@ -35,6 +35,9 @@ export default { ...@@ -35,6 +35,9 @@ export default {
NoteBody, NoteBody,
TimelineEntryItem, TimelineEntryItem,
}, },
directives: {
SafeHtml,
},
mixins: [noteable, resolvable, glFeatureFlagsMixin()], mixins: [noteable, resolvable, glFeatureFlagsMixin()],
props: { props: {
note: { note: {
...@@ -379,7 +382,7 @@ export default { ...@@ -379,7 +382,7 @@ export default {
:is-confidential="note.confidential" :is-confidential="note.confidential"
> >
<slot slot="note-header-info" name="note-header-info"></slot> <slot slot="note-header-info" name="note-header-info"></slot>
<span v-if="commit" v-html="actionText"></span> <span v-if="commit" v-safe-html="actionText"></span>
<span v-else-if="note.created_at" class="d-none d-sm-inline">&middot;</span> <span v-else-if="note.created_at" class="d-none d-sm-inline">&middot;</span>
</note-header> </note-header>
<note-actions <note-actions
......
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