diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/assets/javascripts/notebook/cells/code/index.vue | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/assets/javascripts/notebook/cells/code/index.vue')
-rw-r--r-- | app/assets/javascripts/notebook/cells/code/index.vue | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/app/assets/javascripts/notebook/cells/code/index.vue b/app/assets/javascripts/notebook/cells/code/index.vue index e1ef9aa6d79..64e801a7516 100644 --- a/app/assets/javascripts/notebook/cells/code/index.vue +++ b/app/assets/javascripts/notebook/cells/code/index.vue @@ -1,10 +1,11 @@ <script> -import Prism from '../../lib/highlight'; +import CodeBlockHighlighted from '~/vue_shared/components/code_block_highlighted.vue'; import Prompt from '../prompt.vue'; export default { name: 'CodeOutput', components: { + CodeBlockHighlighted, Prompt, }, props: { @@ -13,11 +14,6 @@ export default { required: false, default: 0, }, - codeCssClass: { - type: String, - required: false, - default: '', - }, type: { type: String, required: true, @@ -41,22 +37,21 @@ export default { return type.charAt(0).toUpperCase() + type.slice(1); }, - cellCssClass() { - return { - [this.codeCssClass]: true, - 'jupyter-notebook-scrolled': this.metadata.scrolled, - }; + maxHeight() { + return this.metadata.scrolled ? '20rem' : 'initial'; }, }, - mounted() { - Prism.highlightElement(this.$refs.code); - }, }; </script> <template> <div :class="type"> <prompt :type="promptType" :count="count" /> - <pre ref="code" :class="cellCssClass" class="language-python" v-text="code"></pre> + <code-block-highlighted + language="python" + :code="code" + :max-height="maxHeight" + class="gl-border" + /> </div> </template> |