From 6dec8c90543cd2336c2f7fca6613fddf609f441b Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Fri, 16 Aug 2024 07:31:26 -0400 Subject: [PATCH] commonmark 0.31.1 compatibility --- CHANGELOG.md | 5 +++++ composer.json | 12 ++++++------ src/Util/RegexHelper.php | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b331504967..e56a25775a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi ## [Unreleased][unreleased] +### Changed + +- Made compatible with CommonMark spec 0.31.1, including: + - Remove `source`, add `search` to list of recognized block tags + ## [2.5.2] - 2024-08-14 ### Changed diff --git a/composer.json b/composer.json index 0dd28291b2..9b90662034 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ "require-dev": { "ext-json": "*", "cebe/markdown": "^1.0", - "commonmark/cmark": "0.31.0", - "commonmark/commonmark.js": "0.31.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", "composer/package-versions-deprecated": "^1.8", "embed/embed": "^4.4", "erusev/parsedown": "^1.0", @@ -56,9 +56,9 @@ "type": "package", "package": { "name": "commonmark/commonmark.js", - "version": "0.31.0", + "version": "0.31.1", "dist": { - "url": "https://github.com/commonmark/commonmark.js/archive/0.31.0.zip", + "url": "https://github.com/commonmark/commonmark.js/archive/0.31.1.zip", "type": "zip" } } @@ -67,9 +67,9 @@ "type": "package", "package": { "name": "commonmark/cmark", - "version": "0.31.0", + "version": "0.31.1", "dist": { - "url": "https://github.com/commonmark/cmark/archive/0.31.0.zip", + "url": "https://github.com/commonmark/cmark/archive/0.31.1.zip", "type": "zip" } } diff --git a/src/Util/RegexHelper.php b/src/Util/RegexHelper.php index cab073d7f9..a89e7bda66 100644 --- a/src/Util/RegexHelper.php +++ b/src/Util/RegexHelper.php @@ -41,7 +41,7 @@ final class RegexHelper public const PARTIAL_REG_CHAR = '[^\\\\()\x00-\x20]'; public const PARTIAL_IN_PARENS_NOSP = '\((' . self::PARTIAL_REG_CHAR . '|' . self::PARTIAL_ESCAPED_CHAR . '|\\\\)*\)'; public const PARTIAL_TAGNAME = '[a-z][a-z0-9-]*'; - 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)'; + 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)'; public const PARTIAL_ATTRIBUTENAME = '[a-z_:][a-z0-9:._-]*'; public const PARTIAL_UNQUOTEDVALUE = '[^"\'=<>`\x00-\x20]+'; public const PARTIAL_SINGLEQUOTEDVALUE = '\'[^\']*\'';