Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-04-03 16:42:23 +0300
committerBrett Walker <bwalker@gitlab.com>2019-04-05 02:59:31 +0300
commit949bcb1f8d9695171d0dc88461f6a16800ac57c9 (patch)
tree2716c2263861178b7ddd366f336700d40a73c35a /spec/services/task_list_toggle_service_spec.rb
parent3ccb4d954f4c51f4f3cc77ebd53f21425e0d4d09 (diff)
Fenced blockquotes to not change source line pos
Replaces blockquote fences with \n, keeping the line numbering intact.
Diffstat (limited to 'spec/services/task_list_toggle_service_spec.rb')
-rw-r--r--spec/services/task_list_toggle_service_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/task_list_toggle_service_spec.rb b/spec/services/task_list_toggle_service_spec.rb
index b1260cf740a..9adaee6481b 100644
--- a/spec/services/task_list_toggle_service_spec.rb
+++ b/spec/services/task_list_toggle_service_spec.rb
@@ -113,4 +113,25 @@ describe TaskListToggleService do
expect(toggler.execute).to be_falsey
end
+
+ it 'properly handles a GitLab blockquote' do
+ markdown =
+ <<-EOT.strip_heredoc
+ >>>
+ gitlab blockquote
+ >>>
+
+ * [ ] 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: 5)
+
+ expect(toggler.execute).to be_truthy
+ expect(toggler.updated_markdown.lines[4]).to eq "* [x] Task 1\n"
+ expect(toggler.updated_markdown_html).to include('disabled checked> Task 1')
+ end
end