Commit ba2ff63b authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/vueReadmeGFM' into 'master'

Correctly render GFM in README files

See merge request gitlab-org/gitlab!25445
parents cd1c160a 6611a836
<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>
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