From ab3e8e1f5a5fecd343e32cc31912ec912449e713 Mon Sep 17 00:00:00 2001 From: Trang Le Date: Thu, 22 Jul 2021 21:01:35 +0700 Subject: [PATCH] fix(widget-markdown): Hitting Enter key in a list item doesn't create a new list item (#5550) --- .../integration/markdown_widget_list_spec.js | 173 +++++++++--------- .../integration/markdown_widget_quote_spec.js | 51 +++++- .../src/MarkdownControl/plugins/List.js | 53 +++++- 3 files changed, 180 insertions(+), 97 deletions(-) diff --git a/cypress/integration/markdown_widget_list_spec.js b/cypress/integration/markdown_widget_list_spec.js index c88cbeae..a1378ac2 100644 --- a/cypress/integration/markdown_widget_list_spec.js +++ b/cypress/integration/markdown_widget_list_spec.js @@ -35,7 +35,7 @@ describe('Markdown widget', () => { `); }); - it('creates nested list when selection is collapsed in non-first block of list item', () => { + it('converts a list item to a paragraph block which is a sibling of the parent list', () => { cy.clickUnorderedListButton() .type('foo') .enter() @@ -44,44 +44,20 @@ describe('Markdown widget', () => { +

`) - .type('bar') - .enter() - .clickUnorderedListButton() - .confirmMarkdownEditorContent(` - - `); }); - it('converts empty nested list item to empty block in parent list item', () => { + it('converts empty nested list item to empty paragraph block in parent list item', () => { cy.clickUnorderedListButton() .type('foo') .enter() - .clickUnorderedListButton() + .tabkey() .type('bar') .enter() - .clickUnorderedListButton() + .tabkey() .confirmMarkdownEditorContent(`