Skip to content

Commit

Permalink
Merge pull request #3 from Aeliot-Tm/leading_symbols_matching
Browse files Browse the repository at this point in the history
Fix: leading symbols may be only a "start of comment"
  • Loading branch information
Aeliot-Tm authored Jun 17, 2024
2 parents 2c9c32b + 2322b4a commit 66ef889
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Service/Tag/Detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66ef889

Please sign in to comment.