diff options
Diffstat (limited to 'app/models/concerns/taskable.rb')
-rw-r--r-- | app/models/concerns/taskable.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/models/concerns/taskable.rb b/app/models/concerns/taskable.rb index e41a0ca28f9..904c96b11b3 100644 --- a/app/models/concerns/taskable.rb +++ b/app/models/concerns/taskable.rb @@ -11,14 +11,16 @@ require 'task_list/filter' module Taskable COMPLETED = 'completed' INCOMPLETE = 'incomplete' - COMPLETE_PATTERN = /(\[[xX]\])/.freeze - INCOMPLETE_PATTERN = /(\[\s\])/.freeze + COMPLETE_PATTERN = /\[[xX]\]/.freeze + INCOMPLETE_PATTERN = /\[[[:space:]]\]/.freeze ITEM_PATTERN = %r{ ^ (?:(?:>\s{0,4})*) # optional blockquote characters ((?:\s*(?:[-+*]|(?:\d+\.)))+) # list prefix (one or more) required - task item has to be always in a list \s+ # whitespace prefix has to be always presented for a list item - (\[\s\]|\[[xX]\]) # checkbox + ( # checkbox + #{COMPLETE_PATTERN}|#{INCOMPLETE_PATTERN} + ) (\s.+) # followed by whitespace and some text. }x.freeze |