diff --git a/src/Extension/Attributes/Util/AttributesHelper.php b/src/Extension/Attributes/Util/AttributesHelper.php index de5c111e1d..41171fae7e 100644 --- a/src/Extension/Attributes/Util/AttributesHelper.php +++ b/src/Extension/Attributes/Util/AttributesHelper.php @@ -23,7 +23,7 @@ */ final class AttributesHelper { - private const SINGLE_ATTRIBUTE = '\s*([.#][_a-z0-9-]+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*'; + private const SINGLE_ATTRIBUTE = '\s*([.]-?[_a-z]\S*|[#]\S+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*'; private const ATTRIBUTE_LIST = '/^{:?(' . self::SINGLE_ATTRIBUTE . ')+}/i'; /** diff --git a/tests/functional/Extension/Attributes/data/class_names.html b/tests/functional/Extension/Attributes/data/class_names.html new file mode 100644 index 0000000000..e92bcd308b --- /dev/null +++ b/tests/functional/Extension/Attributes/data/class_names.html @@ -0,0 +1,6 @@ +

Some text

+

Some text

+

Some text

+

Some text

+

Some text

+

Some text

diff --git a/tests/functional/Extension/Attributes/data/class_names.md b/tests/functional/Extension/Attributes/data/class_names.md new file mode 100644 index 0000000000..25ee4f5a5d --- /dev/null +++ b/tests/functional/Extension/Attributes/data/class_names.md @@ -0,0 +1,17 @@ +{class="some-class(value)"} +Some text + +{.some-class(value)} +Some text + +{.-hello} +Some text + +{.smile-😎 .some-class} +Some text + +{id="smile-😎"} +Some text + +{#smile-😎} +Some text