summaryrefslogtreecommitdiff
path: root/app/services/task_list_toggle_service.rb
diff options
context:
space:
mode:
authorMike Lewis <mlewis@gitlab.com>2019-02-18 21:38:24 +0000
committerMike Lewis <mlewis@gitlab.com>2019-02-18 21:38:24 +0000
commit07c32a0df5306082fe800de1ae6e2c51325f46ef (patch)
tree2d810bcd76a993ac71224de5b5f0b6a7707127df /app/services/task_list_toggle_service.rb
parentf1645c744fcf8677ae14714914c4c4ffb9d5b17e (diff)
parentfe10964a6884162b9272ec3a32a5736c2a997ab2 (diff)
downloadgitlab-ce-07c32a0df5306082fe800de1ae6e2c51325f46ef.tar.gz
Merge branch 'master' into 'template-improvements-for-documentation'
# Conflicts: # .gitlab/merge_request_templates/Documentation.md
Diffstat (limited to 'app/services/task_list_toggle_service.rb')
-rw-r--r--app/services/task_list_toggle_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/task_list_toggle_service.rb b/app/services/task_list_toggle_service.rb
index cfe187d9b12..f6602a35033 100644
--- a/app/services/task_list_toggle_service.rb
+++ b/app/services/task_list_toggle_service.rb
@@ -33,7 +33,7 @@ class TaskListToggleService
markdown_task = source_lines[source_line_index]
# 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 markdown_task.chomp == line_source
return unless source_checkbox = Taskable::ITEM_PATTERN.match(markdown_task)
currently_checked = TaskList::Item.new(source_checkbox[1]).complete?
@@ -67,6 +67,6 @@ class TaskListToggleService
# When using CommonMark, we should be able to use the embedded `sourcepos` attribute to
# target the exact line in the DOM.
def get_html_checkbox(html)
- html.css(".task-list-item[data-sourcepos^='#{line_number}:'] > input.task-list-item-checkbox").first
+ html.css(".task-list-item[data-sourcepos^='#{line_number}:'] input.task-list-item-checkbox").first
end
end