From 2322b4a3225821f4759e995ed612e96525d4a651 Mon Sep 17 00:00:00 2001 From: Anatoliy Melnikov <5785276@gmail.com> Date: Tue, 18 Jun 2024 02:31:19 +0300 Subject: [PATCH] Fix: leading symbols may be only a "start of comment" --- src/Service/Tag/Detector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/Tag/Detector.php b/src/Service/Tag/Detector.php index 39f94ca..e5314ff 100644 --- a/src/Service/Tag/Detector.php +++ b/src/Service/Tag/Detector.php @@ -15,7 +15,7 @@ class Detector */ public function __construct(array $tags = ['todo', 'fixme']) { - $this->pattern = sprintf('/^(.*(%s)(?:@([a-z0-9._-]+))?\b\s*:?)/i', implode('|', $tags)); + $this->pattern = sprintf('~^([\s\#*/]*(%s)(?:@([a-z0-9._-]+))?\b\s*:?)~i', implode('|', $tags)); } public function getTagMetadata(string $line): ?TagMetadata