Commit b4e3a822 authored by Fatih Acet's avatar Fatih Acet

Merge branch '209995-snippet-description-md-render' into 'master'

Resolve "code Snippets Description: Markdown is not rendered (it's just plain text)"

Closes #209995

See merge request gitlab-org/gitlab!27038
parents 2ff3906e daf545a2
......@@ -21,7 +21,7 @@ export default {
{{ snippet.title }}
</h2>
<div v-if="snippet.description" class="description" data-qa-selector="snippet_description">
<div class="md">{{ snippet.description }}</div>
<div class="md js-snippet-description" v-html="snippet.descriptionHtml"></div>
</div>
<small v-if="snippet.updatedAt !== snippet.createdAt" class="edited-text">
......
......@@ -2,6 +2,7 @@ fragment SnippetBase on Snippet {
id
title
description
descriptionHtml
createdAt
updatedAt
visibilityLevel
......
......@@ -6,10 +6,12 @@ describe('Snippet header component', () => {
let wrapper;
const title = 'The property of Thor';
const description = 'Do not touch this hammer';
const descriptionHtml = `<h2>${description}</h2>`;
const snippet = {
snippet: {
title,
description,
descriptionHtml,
},
};
......@@ -35,7 +37,7 @@ describe('Snippet header component', () => {
it('renders snippets title and description', () => {
createComponent();
expect(wrapper.text().trim()).toContain(title);
expect(wrapper.text().trim()).toContain(description);
expect(wrapper.find('.js-snippet-description').element.innerHTML).toBe(descriptionHtml);
});
it('does not render recent changes time stamp if there were no updates', () => {
......
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