Skip to content

Commit 3db9d35

Browse files
committed
Merge branch '2.6'
2 parents 01ad002 + 06c3b0b commit 3db9d35

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
66

77
## [Unreleased][unreleased]
88

9+
## [2.6.2] - 2025-04-18
10+
11+
### Fixed
12+
13+
- Fixed Attributes extension parsing regression (#1071)
14+
915
## [2.6.1] - 2024-12-29
1016

1117
### Fixed
@@ -683,7 +689,8 @@ No changes were introduced since the previous release.
683689
- Alternative 1: Use `CommonMarkConverter` or `GithubFlavoredMarkdownConverter` if you don't need to customize the environment
684690
- Alternative 2: Instantiate a new `Environment` and add the necessary extensions yourself
685691

686-
[unreleased]: https://github.com/thephpleague/commonmark/compare/2.6.1...main
692+
[unreleased]: https://github.com/thephpleague/commonmark/compare/2.6.1...2.6.2
693+
[2.6.2]: https://github.com/thephpleague/commonmark/compare/2.6.1...2.6.2
687694
[2.6.1]: https://github.com/thephpleague/commonmark/compare/2.6.0...2.6.1
688695
[2.6.0]: https://github.com/thephpleague/commonmark/compare/2.5.3...2.6.0
689696
[2.5.3]: https://github.com/thephpleague/commonmark/compare/2.5.2...2.5.3

docs/2.6/customization/extensions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ redirect_from: /customization/extensions/
99

1010
Extensions provide a way to group related parsers, renderers, etc. together with pre-defined priorities, configuration settings, etc. They are perfect for distributing your customizations as reusable, open-source packages that others can plug into their own projects!
1111

12-
To create an extension, simply create a new class implementing `ExtensionInterface`. This has a single method where you're given a `ConfigurableEnvironmentInterface` to register whatever things you need to. For example:
12+
To create an extension, simply create a new class implementing `ExtensionInterface`. This has a single method where you're given a `EnvironmentBuilderInterface` to register whatever things you need to. For example:
1313

1414
```php
1515
use League\CommonMark\Extension\ExtensionInterface;
16-
use League\CommonMark\Environment\ConfigurableEnvironmentInterface;
16+
use League\CommonMark\Environment\EnvironmentBuilderInterface;
1717

1818
final class EmojiExtension implements ExtensionInterface
1919
{
20-
public function register(ConfigurableEnvironmentInterface $environment): void
20+
public function register(EnvironmentBuilderInterface $environment): void
2121
{
2222
$environment
2323
// TODO: Create the EmojiParser, Emoji, and EmojiRenderer classes

src/Extension/Attributes/Util/AttributesHelper.php

+1-1
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

+3
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)