Commit 6611a836 authored by Phil Hughes's avatar Phil Hughes

Correctly render GFM in README files

Correctly renders GFM in README files in the repository listing
parent b4dca6d9
<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