Commit 07a72e8d authored by Nathan Friend's avatar Nathan Friend

Merge branch 'markdown-toolbar-list-style' into 'master'

Make lists use hyphens in markdown toolbar

See merge request gitlab-org/gitlab!31426
parents f89905ce 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"
/>
......
......@@ -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" } }
......
---
title: Set markdown toolbar to use hyphens for lists
merge_request: 31426
author:
type: changed
......@@ -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', () => {
......
......@@ -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');
});
});
});
......
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