summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notebook/cells/output/html.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /app/assets/javascripts/notebook/cells/output/html.vue
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/assets/javascripts/notebook/cells/output/html.vue')
-rw-r--r--app/assets/javascripts/notebook/cells/output/html.vue11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/notebook/cells/output/html.vue b/app/assets/javascripts/notebook/cells/output/html.vue
index a3d7ddd5bad..dc5b2b66348 100644
--- a/app/assets/javascripts/notebook/cells/output/html.vue
+++ b/app/assets/javascripts/notebook/cells/output/html.vue
@@ -1,5 +1,5 @@
<script>
-/* eslint-disable vue/no-v-html */
+import { GlSafeHtmlDirective } from '@gitlab/ui';
import { sanitize } from '~/lib/dompurify';
import Prompt from '../prompt.vue';
@@ -7,6 +7,9 @@ export default {
components: {
Prompt,
},
+ directives: {
+ SafeHtml: GlSafeHtmlDirective,
+ },
props: {
count: {
type: Number,
@@ -23,9 +26,7 @@ export default {
},
computed: {
sanitizedOutput() {
- return sanitize(this.rawCode, {
- ALLOWED_ATTR: ['src'],
- });
+ return sanitize(this.rawCode);
},
showOutput() {
return this.index === 0;
@@ -37,6 +38,6 @@ export default {
<template>
<div class="output">
<prompt type="Out" :count="count" :show-output="showOutput" />
- <div class="gl-overflow-auto" v-html="sanitizedOutput"></div>
+ <div v-safe-html="sanitizedOutput" class="gl-overflow-auto"></div>
</div>
</template>