Commit 5f4da7c2 authored by Andrew Fontaine's avatar Andrew Fontaine

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

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

See merge request gitlab-org/gitlab!41206
parents a8ed9972 05203a17
<script> <script>
/* eslint-disable vue/no-v-html */
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import $ from 'jquery'; import $ from 'jquery';
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import DiffTableCell from './diff_table_cell.vue'; import DiffTableCell from './diff_table_cell.vue';
import { import {
MATCH_LINE_TYPE, MATCH_LINE_TYPE,
...@@ -22,6 +21,7 @@ export default { ...@@ -22,6 +21,7 @@ export default {
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
SafeHtml,
}, },
props: { props: {
fileHash: { fileHash: {
...@@ -161,10 +161,10 @@ export default { ...@@ -161,10 +161,10 @@ export default {
<td :class="parallelViewLeftLineType" class="line-coverage left-side"></td> <td :class="parallelViewLeftLineType" class="line-coverage left-side"></td>
<td <td
:id="line.left.line_code" :id="line.left.line_code"
v-safe-html="line.left.rich_text"
:class="parallelViewLeftLineType" :class="parallelViewLeftLineType"
class="line_content with-coverage parallel left-side" class="line_content with-coverage parallel left-side"
@mousedown="handleParallelLineMouseDown" @mousedown="handleParallelLineMouseDown"
v-html="line.left.rich_text"
></td> ></td>
</template> </template>
<template v-else> <template v-else>
...@@ -193,6 +193,7 @@ export default { ...@@ -193,6 +193,7 @@ export default {
></td> ></td>
<td <td
:id="line.right.line_code" :id="line.right.line_code"
v-safe-html="line.right.rich_text"
:class="[ :class="[
line.right.type, line.right.type,
{ {
...@@ -201,7 +202,6 @@ export default { ...@@ -201,7 +202,6 @@ export default {
]" ]"
class="line_content with-coverage parallel right-side" class="line_content with-coverage parallel right-side"
@mousedown="handleParallelLineMouseDown" @mousedown="handleParallelLineMouseDown"
v-html="line.right.rich_text"
></td> ></td>
</template> </template>
<template v-else> <template v-else>
......
---
title: Replace v-html with v-safe-html in parallel_diff_table_row.vue
merge_request: 41206
author: Kev @KevSlashNull
type: other
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