Skip to content

Commit ac01aa5

Browse files
authored
Merge pull request #1041 from thephpleague/commonmark-0.31.1
commonmark 0.31.1 compatibility
2 parents df09d5b + e41a23d commit ac01aa5

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

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

77
## [Unreleased][unreleased]
88

9+
### Changed
10+
11+
- Made compatible with CommonMark spec 0.31.1, including:
12+
- Remove `source`, add `search` to list of recognized block tags
13+
914
## [2.5.2] - 2024-08-14
1015

1116
### Changed

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"require-dev": {
3232
"ext-json": "*",
3333
"cebe/markdown": "^1.0",
34-
"commonmark/cmark": "0.31.0",
35-
"commonmark/commonmark.js": "0.31.0",
34+
"commonmark/cmark": "0.31.1",
35+
"commonmark/commonmark.js": "0.31.1",
3636
"composer/package-versions-deprecated": "^1.8",
3737
"embed/embed": "^4.4",
3838
"erusev/parsedown": "^1.0",
@@ -56,9 +56,9 @@
5656
"type": "package",
5757
"package": {
5858
"name": "commonmark/commonmark.js",
59-
"version": "0.31.0",
59+
"version": "0.31.1",
6060
"dist": {
61-
"url": "https://github.com/commonmark/commonmark.js/archive/0.31.0.zip",
61+
"url": "https://github.com/commonmark/commonmark.js/archive/0.31.1.zip",
6262
"type": "zip"
6363
}
6464
}
@@ -67,9 +67,9 @@
6767
"type": "package",
6868
"package": {
6969
"name": "commonmark/cmark",
70-
"version": "0.31.0",
70+
"version": "0.31.1",
7171
"dist": {
72-
"url": "https://github.com/commonmark/cmark/archive/0.31.0.zip",
72+
"url": "https://github.com/commonmark/cmark/archive/0.31.1.zip",
7373
"type": "zip"
7474
}
7575
}

src/Util/RegexHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class RegexHelper
4141
public const PARTIAL_REG_CHAR = '[^\\\\()\x00-\x20]';
4242
public const PARTIAL_IN_PARENS_NOSP = '\((' . self::PARTIAL_REG_CHAR . '|' . self::PARTIAL_ESCAPED_CHAR . '|\\\\)*\)';
4343
public const PARTIAL_TAGNAME = '[a-z][a-z0-9-]*';
44-
public const PARTIAL_BLOCKTAGNAME = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)';
44+
public const PARTIAL_BLOCKTAGNAME = '(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)';
4545
public const PARTIAL_ATTRIBUTENAME = '[a-z_:][a-z0-9:._-]*';
4646
public const PARTIAL_UNQUOTEDVALUE = '[^"\'=<>`\x00-\x20]+';
4747
public const PARTIAL_SINGLEQUOTEDVALUE = '\'[^\']*\'';

tests/functional/CMarkRegressionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public static function dataProvider(): \Generator
3333
$example['output'] = \str_replace('</script></li>', "</script>\n</li>", $example['output']);
3434
}
3535

36+
// The case-fold test from example 21 fails on PHP 8.0.* and below due to the behavior of mb_convert_case().
37+
// See https://3v4l.org/7TeXJ.
38+
if (\PHP_VERSION_ID < 81000 && $example['number'] === 21) {
39+
continue;
40+
}
41+
3642
yield $example;
3743
}
3844
}

0 commit comments

Comments
 (0)