From b2bbf48c18d565d02bc59252a35047b4ec3b9d30 Mon Sep 17 00:00:00 2001 From: Robert Wolff Date: Thu, 25 Jul 2024 00:42:05 +0200 Subject: [PATCH] simplify regex for checkbox detection --- models/issues/issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/issues/issue.go b/models/issues/issue.go index 34ece540e..f7379b7e0 100644 --- a/models/issues/issue.go +++ b/models/issues/issue.go @@ -153,8 +153,8 @@ type Issue struct { } var ( - issueTasksPat = regexp.MustCompile(`(^\s*[-*]\s*\[[\sxX]\])|(\n\s*[-*]\s*\[[\sxX]\])`) - issueTasksDonePat = regexp.MustCompile(`(^\s*[-*]\s*\[[xX]\])|(\n\s*[-*]\s*\[[xX]\])`) + issueTasksPat = regexp.MustCompile(`(^|\n)\s*[-*]\s*\[[\sxX]\]`) + issueTasksDonePat = regexp.MustCompile(`(^|\n)\s*[-*]\s*\[[xX]\]`) ) // IssueIndex represents the issue index table