Handle tag specialization correctly

This commit is contained in:
Jaapio
2020-02-09 09:05:22 +01:00
parent ed7b7919e3
commit 264bd1fff7
2 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ use function trim;
final class StandardTagFactory implements TagFactory
{
/** PCRE regular expression matching a tag name. */
public const REGEX_TAGNAME = '[\w\-\_\\\\]+';
public const REGEX_TAGNAME = '[\w\-\_\\\\:]+';
/**
* @var string[] An array with a tag as a key, and an
@@ -194,7 +194,7 @@ final class StandardTagFactory implements TagFactory
private function extractTagParts(string $tagLine) : array
{
$matches = [];
if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')((?:[\s\(\{:])\s*([^\s].*)|$)/us', $tagLine, $matches)) {
if (!preg_match('/^@(' . self::REGEX_TAGNAME . ')((?:[\s\(\{])\s*([^\s].*)|$)/us', $tagLine, $matches)) {
throw new InvalidArgumentException(
'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'
);