diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-01-30 03:31:31 +0300 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-02-07 18:28:35 +0300 |
commit | 79bd1b8717599205fd1bf4f79048d3065b500536 (patch) | |
tree | 5c69bd43f58997d97504cc2063c6064f434ba11f /app/services/task_list_toggle_service.rb | |
parent | ca154f0ff4f15d717a0fcf7a3cb75921ba6880ee (diff) |
Enable fast task lists for merge requests
Allow single tasks to be updated quickly
Diffstat (limited to 'app/services/task_list_toggle_service.rb')
-rw-r--r-- | app/services/task_list_toggle_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/task_list_toggle_service.rb b/app/services/task_list_toggle_service.rb index b5c4cd3235d..cfe187d9b12 100644 --- a/app/services/task_list_toggle_service.rb +++ b/app/services/task_list_toggle_service.rb @@ -32,7 +32,8 @@ class TaskListToggleService source_line_index = line_number - 1 markdown_task = source_lines[source_line_index] - return unless markdown_task == line_source + # The source in the DB could be using either \n or \r\n line endings + return unless markdown_task == line_source || markdown_task == line_source + "\r" return unless source_checkbox = Taskable::ITEM_PATTERN.match(markdown_task) currently_checked = TaskList::Item.new(source_checkbox[1]).complete? |