Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
daf545a2
Commit
daf545a2
authored
Mar 11, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed markdown rendering of Snippet description
parent
0cfb4ae0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
app/assets/javascripts/snippets/components/snippet_title.vue
app/assets/javascripts/snippets/components/snippet_title.vue
+1
-1
app/assets/javascripts/snippets/fragments/snippetBase.fragment.graphql
...vascripts/snippets/fragments/snippetBase.fragment.graphql
+1
-0
spec/frontend/snippets/components/snippet_title_spec.js
spec/frontend/snippets/components/snippet_title_spec.js
+3
-1
No files found.
app/assets/javascripts/snippets/components/snippet_title.vue
View file @
daf545a2
...
@@ -21,7 +21,7 @@ export default {
...
@@ -21,7 +21,7 @@ export default {
{{
snippet
.
title
}}
{{
snippet
.
title
}}
</h2>
</h2>
<div
v-if=
"snippet.description"
class=
"description"
data-qa-selector=
"snippet_description"
>
<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>
</div>
<small
v-if=
"snippet.updatedAt !== snippet.createdAt"
class=
"edited-text"
>
<small
v-if=
"snippet.updatedAt !== snippet.createdAt"
class=
"edited-text"
>
...
...
app/assets/javascripts/snippets/fragments/snippetBase.fragment.graphql
View file @
daf545a2
...
@@ -2,6 +2,7 @@ fragment SnippetBase on Snippet {
...
@@ -2,6 +2,7 @@ fragment SnippetBase on Snippet {
id
id
title
title
description
description
descriptionHtml
createdAt
createdAt
updatedAt
updatedAt
visibilityLevel
visibilityLevel
...
...
spec/frontend/snippets/components/snippet_title_spec.js
View file @
daf545a2
...
@@ -6,10 +6,12 @@ describe('Snippet header component', () => {
...
@@ -6,10 +6,12 @@ describe('Snippet header component', () => {
let
wrapper
;
let
wrapper
;
const
title
=
'
The property of Thor
'
;
const
title
=
'
The property of Thor
'
;
const
description
=
'
Do not touch this hammer
'
;
const
description
=
'
Do not touch this hammer
'
;
const
descriptionHtml
=
`<h2>
${
description
}
</h2>`
;
const
snippet
=
{
const
snippet
=
{
snippet
:
{
snippet
:
{
title
,
title
,
description
,
description
,
descriptionHtml
,
},
},
};
};
...
@@ -35,7 +37,7 @@ describe('Snippet header component', () => {
...
@@ -35,7 +37,7 @@ describe('Snippet header component', () => {
it
(
'
renders snippets title and description
'
,
()
=>
{
it
(
'
renders snippets title and description
'
,
()
=>
{
createComponent
();
createComponent
();
expect
(
wrapper
.
text
().
trim
()).
toContain
(
title
);
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
'
,
()
=>
{
it
(
'
does not render recent changes time stamp if there were no updates
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment