Commit a90bd061 authored by Illya Klymov's avatar Illya Klymov

Merge branch '241933-Replace-v-html' into 'master'

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

See merge request gitlab-org/gitlab!41135
parents deb72ebb 1210ce01
<script> <script>
/* eslint-disable vue/no-v-html */
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 +34,9 @@ export default { ...@@ -35,6 +34,9 @@ export default {
NoteBody, NoteBody,
TimelineEntryItem, TimelineEntryItem,
}, },
directives: {
SafeHtml,
},
mixins: [noteable, resolvable, glFeatureFlagsMixin()], mixins: [noteable, resolvable, glFeatureFlagsMixin()],
props: { props: {
note: { note: {
...@@ -379,7 +381,7 @@ export default { ...@@ -379,7 +381,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