diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/assets/javascripts/notebook | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/assets/javascripts/notebook')
-rw-r--r-- | app/assets/javascripts/notebook/cells/markdown.vue | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/notebook/cells/markdown.vue b/app/assets/javascripts/notebook/cells/markdown.vue index 1384c9c40b3..073b27605bb 100644 --- a/app/assets/javascripts/notebook/cells/markdown.vue +++ b/app/assets/javascripts/notebook/cells/markdown.vue @@ -1,6 +1,7 @@ <script> import katex from 'katex'; import marked from 'marked'; +import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import { sanitize } from '~/lib/dompurify'; import { hasContent, markdownConfig } from '~/lib/utils/text_utility'; import Prompt from './prompt.vue'; @@ -138,6 +139,9 @@ export default { components: { prompt: Prompt, }, + directives: { + SafeHtml, + }, inject: ['relativeRawPath'], props: { cell: { @@ -150,16 +154,17 @@ export default { renderer.attachments = this.cell.attachments; renderer.relativeRawPath = this.relativeRawPath; - return sanitize(marked(this.cell.source.join('').replace(/\\/g, '\\\\')), markdownConfig); + return marked(this.cell.source.join('').replace(/\\/g, '\\\\')); }, }, + markdownConfig, }; </script> <template> <div class="cell text-cell"> <prompt /> - <div class="markdown" v-html="markdown /* eslint-disable-line vue/no-v-html */"></div> + <div v-safe-html:[$options.markdownConfig]="markdown" class="markdown"></div> </div> </template> |