diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-07-19 11:37:35 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-07-19 12:40:16 -0500 |
commit | b1694896ffd4dcf8bc54d19b5d513813e63d6121 (patch) | |
tree | 579b92050cc6ce6f01f83f9e8df5c6c7e39de885 /spec/services/task_list_toggle_service_spec.rb | |
parent | 2e56b134687ccc8043f14eef4c5d0bfa9e1fd370 (diff) | |
download | gitlab-ce-b1694896ffd4dcf8bc54d19b5d513813e63d6121.tar.gz |
Properly identify task lists inside a blockquote64697-markdown-issues-checkbox-inside-blockquote-status-won-t-be-saved
Updated the task list regex to understand blockquote
characters that can come before the task item marker
Diffstat (limited to 'spec/services/task_list_toggle_service_spec.rb')
-rw-r--r-- | spec/services/task_list_toggle_service_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/task_list_toggle_service_spec.rb b/spec/services/task_list_toggle_service_spec.rb index 9adaee6481b..a309951bbcb 100644 --- a/spec/services/task_list_toggle_service_spec.rb +++ b/spec/services/task_list_toggle_service_spec.rb @@ -114,6 +114,23 @@ describe TaskListToggleService do expect(toggler.execute).to be_falsey end + it 'properly handles tasks in a blockquote' do + markdown = + <<-EOT.strip_heredoc + > > * [ ] Task 1 + > * [x] Task 2 + EOT + + markdown_html = Banzai::Pipeline::FullPipeline.call(markdown, project: nil)[:output].to_html + toggler = described_class.new(markdown, markdown_html, + toggle_as_checked: true, + line_source: '> > * [ ] Task 1', line_number: 1) + + expect(toggler.execute).to be_truthy + expect(toggler.updated_markdown.lines[0]).to eq "> > * [x] Task 1\n" + expect(toggler.updated_markdown_html).to include('disabled checked> Task 1') + end + it 'properly handles a GitLab blockquote' do markdown = <<-EOT.strip_heredoc |