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
1285fe68
Commit
1285fe68
authored
Dec 11, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary div from MarkdownField to apply list styles correctly
parent
b388111f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
app/assets/javascripts/vue_shared/components/markdown/field.vue
...sets/javascripts/vue_shared/components/markdown/field.vue
+9
-6
changelogs/unreleased/winh-markdown-preview-lists.yml
changelogs/unreleased/winh-markdown-preview-lists.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/javascripts/vue_shared/components/markdown/field_spec.js
.../javascripts/vue_shared/components/markdown/field_spec.js
+1
-1
No files found.
app/assets/javascripts/vue_shared/components/markdown/field.vue
View file @
1285fe68
<
script
>
import
$
from
'
jquery
'
;
import
{
s
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
Flash
from
'
../../../flash
'
;
import
GLForm
from
'
../../../gl_form
'
;
import
markdownHeader
from
'
./header.vue
'
;
...
...
@@ -99,11 +99,12 @@ export default {
if
(
text
)
{
this
.
markdownPreviewLoading
=
true
;
this
.
markdownPreview
=
__
(
'
Loading…
'
);
this
.
$http
.
post
(
this
.
versionedPreviewPath
(),
{
text
})
.
then
(
resp
=>
resp
.
json
())
.
then
(
data
=>
this
.
renderMarkdown
(
data
))
.
catch
(()
=>
new
Flash
(
s
__
(
'
Error loading markdown preview
'
)));
.
catch
(()
=>
new
Flash
(
__
(
'
Error loading markdown preview
'
)));
}
else
{
this
.
renderMarkdown
();
}
...
...
@@ -162,10 +163,12 @@ export default {
/>
</div>
</div>
<div
v-show=
"previewMarkdown"
class=
"md md-preview-holder md-preview js-vue-md-preview"
>
<div
ref=
"markdown-preview"
v-html=
"markdownPreview"
></div>
<span
v-if=
"markdownPreviewLoading"
>
Loading...
</span>
</div>
<div
v-show=
"previewMarkdown"
ref=
"markdown-preview"
class=
"md-preview js-vue-md-preview md md-preview-holder"
v-html=
"markdownPreview"
></div>
<template
v-if=
"previewMarkdown && !markdownPreviewLoading"
>
<div
v-if=
"referencedCommands"
class=
"referenced-commands"
v-html=
"referencedCommands"
></div>
<div
v-if=
"shouldShowReferencedUsers"
class=
"referenced-users"
>
...
...
changelogs/unreleased/winh-markdown-preview-lists.yml
0 → 100644
View file @
1285fe68
---
title
:
Remove unnecessary div from MarkdownField to apply list styles correctly
merge_request
:
23733
author
:
type
:
fixed
locale/gitlab.pot
View file @
1285fe68
...
...
@@ -3919,6 +3919,9 @@ msgstr ""
msgid "Loading..."
msgstr ""
msgid "Loading…"
msgstr ""
msgid "Lock"
msgstr ""
...
...
spec/javascripts/vue_shared/components/markdown/field_spec.js
View file @
1285fe68
...
...
@@ -80,7 +80,7 @@ describe('Markdown field component', () => {
previewLink
.
click
();
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.md-preview
'
).
textContent
.
trim
()).
toContain
(
'
Loading
...
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.md-preview
'
).
textContent
.
trim
()).
toContain
(
'
Loading
…
'
);
done
();
});
...
...
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