Skip to content

Commit 771974c

Browse files
committed
Fix Attributes extension parsing regression (#1071)
1 parent e99ee2e commit 771974c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
66

77
## [Unreleased][unreleased]
88

9+
### Fixed
10+
11+
- Fixed Attributes extension parsing regression (#1071)
12+
913
## [2.6.1] - 2024-12-29
1014

1115
### Fixed

src/Extension/Attributes/Util/AttributesHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
final class AttributesHelper
2525
{
26-
private const SINGLE_ATTRIBUTE = '\s*([.]-?[_a-z][^\s}]*|[#][^\s}]+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*';
26+
private const SINGLE_ATTRIBUTE = '\s*([.]-?[_a-z][^\s.}]*|[#][^\s}]+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*';
2727
private const ATTRIBUTE_LIST = '/^{:?(' . self::SINGLE_ATTRIBUTE . ')+}/i';
2828

2929
/**

tests/unit/Extension/Attributes/Util/AttributesHelperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public static function dataForTestParseAttributes(): iterable
108108
yield [new Cursor('{{ foo }}'), [], '{{ foo }}'];
109109
yield [new Cursor(' {{ foo }}'), [], ' {{ foo }}'];
110110
yield [new Cursor('{ foo }}'), [], '{ foo }}'];
111+
112+
// Issue 1071
113+
yield [new Cursor('{.display-4.mt-5.mx-auto}'), ['class' => 'display-4 mt-5 mx-auto']];
111114
}
112115

113116
/**

0 commit comments

Comments
 (0)