diff --git a/CHANGELOG.md b/CHANGELOG.md index c4880fd164..2e25f3b533 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi - `FencedCodeRenderer`: don't add `language-` to class if already prefixed - Compatibility issues with CommonMark spec 0.31.0, including: - Allow closing fence to be followed by tabs + - Remove restrictive limitation on inline comments ## [2.4.1] - 2023-08-30 diff --git a/src/Util/RegexHelper.php b/src/Util/RegexHelper.php index 7144332a0c..c0bc45ded0 100644 --- a/src/Util/RegexHelper.php +++ b/src/Util/RegexHelper.php @@ -53,7 +53,7 @@ final class RegexHelper public const PARTIAL_CLOSETAG = '<\/' . self::PARTIAL_TAGNAME . '\s*[>]'; public const PARTIAL_OPENBLOCKTAG = '<' . self::PARTIAL_BLOCKTAGNAME . self::PARTIAL_ATTRIBUTE . '*' . '\s*\/?>'; public const PARTIAL_CLOSEBLOCKTAG = '<\/' . self::PARTIAL_BLOCKTAGNAME . '\s*[>]'; - public const PARTIAL_HTMLCOMMENT = '|'; + public const PARTIAL_HTMLCOMMENT = '||'; public const PARTIAL_PROCESSINGINSTRUCTION = '[<][?][\s\S]*?[?][>]'; public const PARTIAL_DECLARATION = ']*>'; public const PARTIAL_CDATA = ''; diff --git a/tests/unit/Util/RegexHelperTest.php b/tests/unit/Util/RegexHelperTest.php index 463e23f1da..c71a6e079c 100644 --- a/tests/unit/Util/RegexHelperTest.php +++ b/tests/unit/Util/RegexHelperTest.php @@ -215,9 +215,9 @@ public function testHtmlComment(): void $this->assertRegexMatches($regex, ''); $this->assertRegexMatches($regex, ''); $this->assertRegexMatches($regex, ''); + $this->assertRegexMatches($regex, ''); + $this->assertRegexMatches($regex, ''); $this->assertRegexDoesNotMatch($regex, ''); - $this->assertRegexDoesNotMatch($regex, ''); - $this->assertRegexDoesNotMatch($regex, ''); $this->assertRegexDoesNotMatch($regex, ''); }