Skip to content

Error raised when `[ ]` appears on it's own line

@deckar01 We've had a report of the following causing an error

- one
  - foo
    [ ] bar

We get

NoMethodError: undefined method `captures' for nil:NilClass
from /Users/myuser/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/deckar01-task_list-2.3.3/lib/task_list/filter.rb:128:in `block in filter!'

It looks like this was broken by Add task-list only to parent of task-list-item (!5 - merged)

I tried 3.0.alpha2, and it does not have the problem and does pass the Gitlab pipeline gitlab-org/gitlab!146372 (merged). But I'm hesitant to include something marked alpha. Do you have a timeline when you think it will be out of alpha? Looking at the current changes it almost seems like this could be a 2.3.4

However I do actually think this is a syntax error. Putting the [ ] on its own line but still recognized as a task list item probably shouldn't be valid syntax. GFM doesn't support this scenario. I think the best would be to not convert it into a task item.

Edited by Brett Walker