Commit 5d852c6f authored by Takuya Noguchi's avatar Takuya Noguchi

Remove v-html from diffs/.../diff_file.vue

Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent e36f62ad
<script> <script>
/* eslint-disable vue/no-v-html */
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon, 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 { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
...@@ -18,6 +17,9 @@ export default { ...@@ -18,6 +17,9 @@ export default {
DiffContent, DiffContent,
GlLoadingIcon, GlLoadingIcon,
}, },
directives: {
SafeHtml,
},
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
props: { props: {
file: { file: {
...@@ -182,7 +184,7 @@ export default { ...@@ -182,7 +184,7 @@ export default {
/> />
<div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion"> <div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion">
<span class="file-fork-suggestion-note" v-html="forkMessage"></span> <span v-safe-html="forkMessage" class="file-fork-suggestion-note"></span>
<a <a
:href="file.fork_path" :href="file.fork_path"
class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success" class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success"
...@@ -200,7 +202,7 @@ export default { ...@@ -200,7 +202,7 @@ export default {
<template v-else> <template v-else>
<div :id="`diff-content-${file.file_hash}`"> <div :id="`diff-content-${file.file_hash}`">
<div v-if="errorMessage" class="diff-viewer"> <div v-if="errorMessage" class="diff-viewer">
<div class="nothing-here-block" v-html="errorMessage"></div> <div v-safe-html="errorMessage" class="nothing-here-block"></div>
</div> </div>
<template v-else> <template v-else>
<div v-show="isCollapsed" class="nothing-here-block diff-collapsed"> <div v-show="isCollapsed" class="nothing-here-block diff-collapsed">
......
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