Skip to content

Commit

Permalink
Add support for numbers in the tag names.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivopetkov committed May 20, 2024
1 parent 03503ce commit 61248ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HTMLServerComponentsCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public function addAlias(string $alias, string $original)
*/
public function addTag(string $tagName, string $src)
{
if (preg_match('/^[a-z\-]+$/', $tagName) !== 1) {
throw new \InvalidArgumentException('The tag name provided is not valid! It may contain letters (a-z) and dashes (-).');
if (preg_match('/^[a-z0-9\-]+$/', $tagName) !== 1) {
throw new \InvalidArgumentException('The tag name provided is not valid! It may contain letters (a-z), numbers (0-9) and dashes (-).');
}
$this->tags[strtolower(trim($tagName))] = $src;
}
Expand Down

0 comments on commit 61248ff

Please sign in to comment.