diff --git a/app/assets/javascripts/task_list.coffee b/app/assets/javascripts/task_list.coffee index fbb08d8..5f115f5 100644 --- a/app/assets/javascripts/task_list.coffee +++ b/app/assets/javascripts/task_list.coffee @@ -125,11 +125,14 @@ itemPattern = /// #{escapePattern(complete)}| #{escapePattern(incomplete)} ) - (?! # is not a link - \s* # with optional whitespace - (?:\(.*?\)|\[.*?\]) # because of destination or reference + \s+ # is followed by whitespace + (?! + \(.*?\) # is not part of a [foo](url) link + ) + (?= # and is followed by zero or more links + (?:\[.*?\]\s*(?:\[.*?\]|\(.*?\))\s*)* + (?:[^\[]|$) # and either a non-link or the end of the string ) - (?=\s) # is followed by whitespace /// # Used to filter out code fences from the source for comparison only. diff --git a/test/unit/test_updates.coffee b/test/unit/test_updates.coffee index c5b55e5..2fc417c 100644 --- a/test/unit/test_updates.coffee +++ b/test/unit/test_updates.coffee @@ -506,3 +506,61 @@ asyncTest "update ignores items that look like Task List items but are links", - , 20 item2Checkbox.click() + +asyncTest "updates items followed by links", -> + expect 3 + + $('#qunit-fixture').empty() + + container = $ '
', class: 'js-task-list-container' + + list = $ '