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
f5a58a3d
Commit
f5a58a3d
authored
Jun 01, 2020
by
Marcel Amirault
Committed by
Nathan Friend
Jun 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make lists use hyphens in markdown toolbar
parent
60fcd514
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
14 deletions
+19
-14
app/assets/javascripts/vue_shared/components/markdown/header.vue
...ets/javascripts/vue_shared/components/markdown/header.vue
+2
-2
app/views/projects/blob/_markdown_buttons.html.haml
app/views/projects/blob/_markdown_buttons.html.haml
+2
-2
changelogs/unreleased/markdown-toolbar-list-style.yml
changelogs/unreleased/markdown-toolbar-list-style.yml
+5
-0
spec/frontend/lib/utils/text_markdown_spec.js
spec/frontend/lib/utils/text_markdown_spec.js
+8
-8
spec/frontend/vue_shared/components/markdown/field_spec.js
spec/frontend/vue_shared/components/markdown/field_spec.js
+2
-2
No files found.
app/assets/javascripts/vue_shared/components/markdown/header.vue
View file @
f5a58a3d
...
...
@@ -158,7 +158,7 @@ export default {
<div
class=
"d-inline-block ml-md-2 ml-0"
>
<toolbar-button
:prepend=
"true"
tag=
"
*
"
tag=
"
-
"
:button-title=
"__('Add a bullet list')"
icon=
"list-bulleted"
/>
...
...
@@ -170,7 +170,7 @@ export default {
/>
<toolbar-button
:prepend=
"true"
tag=
"
*
[ ] "
tag=
"
-
[ ] "
:button-title=
"__('Add a task list')"
icon=
"list-task"
/>
...
...
app/views/projects/blob/_markdown_buttons.html.haml
View file @
f5a58a3d
...
...
@@ -4,9 +4,9 @@
=
markdown_toolbar_button
({
icon:
"quote"
,
data:
{
"md-tag"
=>
"> "
,
"md-prepend"
=>
true
},
title:
_
(
"Insert a quote"
)
})
=
markdown_toolbar_button
({
icon:
"code"
,
data:
{
"md-tag"
=>
"`"
,
"md-block"
=>
"```"
},
title:
_
(
"Insert code"
)
})
=
markdown_toolbar_button
({
icon:
"link"
,
data:
{
"md-tag"
=>
"[{text}](url)"
,
"md-select"
=>
"url"
},
title:
_
(
"Add a link"
)
})
=
markdown_toolbar_button
({
icon:
"list-bulleted"
,
data:
{
"md-tag"
=>
"
*
"
,
"md-prepend"
=>
true
},
title:
_
(
"Add a bullet list"
)
})
=
markdown_toolbar_button
({
icon:
"list-bulleted"
,
data:
{
"md-tag"
=>
"
-
"
,
"md-prepend"
=>
true
},
title:
_
(
"Add a bullet list"
)
})
=
markdown_toolbar_button
({
icon:
"list-numbered"
,
data:
{
"md-tag"
=>
"1. "
,
"md-prepend"
=>
true
},
title:
_
(
"Add a numbered list"
)
})
=
markdown_toolbar_button
({
icon:
"list-task"
,
data:
{
"md-tag"
=>
"
*
[ ] "
,
"md-prepend"
=>
true
},
title:
_
(
"Add a task list"
)
})
=
markdown_toolbar_button
({
icon:
"list-task"
,
data:
{
"md-tag"
=>
"
-
[ ] "
,
"md-prepend"
=>
true
},
title:
_
(
"Add a task list"
)
})
=
markdown_toolbar_button
({
icon:
"table"
,
data:
{
"md-tag"
=>
"| header | header |
\n
| ------ | ------ |
\n
| cell | cell |
\n
| cell | cell |"
,
"md-prepend"
=>
true
},
title:
_
(
"Add a table"
)
})
-
if
show_fullscreen_button
%button
.toolbar-btn.toolbar-fullscreen-btn.js-zen-enter.has-tooltip
{
type:
"button"
,
tabindex:
-
1
,
"aria-label"
:
"Go full screen"
,
title:
_
(
"Go full screen"
),
data:
{
container:
"body"
}
}
...
...
changelogs/unreleased/markdown-toolbar-list-style.yml
0 → 100644
View file @
f5a58a3d
---
title
:
Set markdown toolbar to use hyphens for lists
merge_request
:
31426
author
:
type
:
changed
spec/frontend/lib/utils/text_markdown_spec.js
View file @
f5a58a3d
...
...
@@ -25,13 +25,13 @@ describe('init markdown', () => {
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
:
'
*
'
,
tag
:
'
-
'
,
blockTag
:
null
,
selected
:
''
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
*
`
);
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
-
`
);
});
it
(
'
inserts the tag on a new line if the current one is not empty
'
,
()
=>
{
...
...
@@ -43,13 +43,13 @@ describe('init markdown', () => {
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
:
'
*
'
,
tag
:
'
-
'
,
blockTag
:
null
,
selected
:
''
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
\n
*
`
);
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
\n
-
`
);
});
it
(
'
inserts the tag on the same line if the current line only contains spaces
'
,
()
=>
{
...
...
@@ -61,13 +61,13 @@ describe('init markdown', () => {
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
:
'
*
'
,
tag
:
'
-
'
,
blockTag
:
null
,
selected
:
''
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
*
`
);
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
-
`
);
});
it
(
'
inserts the tag on the same line if the current line only contains tabs
'
,
()
=>
{
...
...
@@ -79,13 +79,13 @@ describe('init markdown', () => {
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
:
'
*
'
,
tag
:
'
-
'
,
blockTag
:
null
,
selected
:
''
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
*
`
);
expect
(
textArea
.
value
).
toEqual
(
`
${
initialValue
}
-
`
);
});
it
(
'
places the cursor inside the tags
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/markdown/field_spec.js
View file @
f5a58a3d
...
...
@@ -185,7 +185,7 @@ describe('Markdown field component', () => {
markdownButton
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
*
testing
'
);
expect
(
textarea
.
value
).
toContain
(
'
-
testing
'
);
});
});
...
...
@@ -197,7 +197,7 @@ describe('Markdown field component', () => {
markdownButton
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
textarea
.
value
).
toContain
(
'
* testing
\n
*
123
'
);
expect
(
textarea
.
value
).
toContain
(
'
- testing
\n
-
123
'
);
});
});
});
...
...
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