Skip to content

Commit

Permalink
Remove restrictive limitation on inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Feb 2, 2024
1 parent 2d11d8f commit 42ca918
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Util/RegexHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<![A-Z]+' . '[^>]*>';
public const PARTIAL_CDATA = '<!\[CDATA\[[\s\S]*?]\]>';
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Util/RegexHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ public function testHtmlComment(): void
$this->assertRegexMatches($regex, '<!---->');
$this->assertRegexMatches($regex, '<!-- -->');
$this->assertRegexMatches($regex, '<!-- HELLO WORLD -->');
$this->assertRegexMatches($regex, '<!-->');
$this->assertRegexMatches($regex, '<!--->');
$this->assertRegexDoesNotMatch($regex, '<!->');
$this->assertRegexDoesNotMatch($regex, '<!-->');
$this->assertRegexDoesNotMatch($regex, '<!--->');
$this->assertRegexDoesNotMatch($regex, '<!- ->');
}

Expand Down

0 comments on commit 42ca918

Please sign in to comment.