Skip to content

Commit 8b68556

Browse files
committed
Fix issue with hyphens in endx names
1 parent 0a60be1 commit 8b68556

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.2 - 2020-02-12
2+
### Fixed
3+
- Fix issue with hyphens in endx names
4+
15
## 1.0.1 - 2020-02-12
26
### Improved
37
- Added self-closing tag support!

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ether/atom",
33
"description": "Adding enhanced modularity to Craft CMS Twig templating",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"type": "craft-plugin",
66
"license": "MIT",
77
"minimum-stability": "dev",

src/web/twig/tokenparsers/AtomTokenParser.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ public function parse (Token $token): Node
9494

9595
$stream->expect(Token::PUNCTUATION_TYPE, ':');
9696
$stream->nextIf(Token::PUNCTUATION_TYPE, '[');
97-
$stream->expect(Token::NAME_TYPE, $strHandle);
97+
foreach (preg_split('/(-)/', $strHandle, -1, PREG_SPLIT_DELIM_CAPTURE) as $word)
98+
{
99+
if ($word === '-') $stream->expect(Token::OPERATOR_TYPE, $word);
100+
else $stream->expect(Token::NAME_TYPE, $word);
101+
}
98102
$stream->nextIf(Token::PUNCTUATION_TYPE, ']');
99103
}
100104

0 commit comments

Comments
 (0)