diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 12:09:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-19 12:09:13 +0000 |
commit | cd3e2c7b9355f8990ab294b34b5e4add4f3985fa (patch) | |
tree | 77264b3e569ec95da8476f604d3d5cf4b03e85dc /app/assets/javascripts/repository | |
parent | c1fc5da123a1fe670e32740669a9d5e59eff38f5 (diff) | |
download | gitlab-ce-cd3e2c7b9355f8990ab294b34b5e4add4f3985fa.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r-- | app/assets/javascripts/repository/components/preview/index.vue | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/assets/javascripts/repository/components/preview/index.vue b/app/assets/javascripts/repository/components/preview/index.vue index 2bc93c3f1c1..78ae719ba0d 100644 --- a/app/assets/javascripts/repository/components/preview/index.vue +++ b/app/assets/javascripts/repository/components/preview/index.vue @@ -1,4 +1,6 @@ <script> +import $ from 'jquery'; +import '~/behaviors/markdown/render_gfm'; import { GlLink, GlLoadingIcon } from '@gitlab/ui'; import getReadmeQuery from '../../queries/getReadme.query.graphql'; @@ -30,6 +32,15 @@ export default { loading: 0, }; }, + watch: { + readme(newVal) { + if (newVal) { + this.$nextTick(() => { + $(this.$refs.readme).renderGFM(); + }); + } + }, + }, }; </script> @@ -45,7 +56,7 @@ export default { </div> <div class="blob-viewer"> <gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" /> - <div v-else-if="readme" v-html="readme.html"></div> + <div v-else-if="readme" ref="readme" v-html="readme.html"></div> </div> </article> </template> |