Skip to content

Commit

Permalink
fix deprecation notice for phpmarkdown lib
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 authored and trasher committed Aug 31, 2023
1 parent e000dbd commit 8c3abf5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@
"@php -f vendor/bin/build_hw_jsons",
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-invalid-header-ignore.patch || true",
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-address-no-length-check.patch || true",
"patch -f -p1 -d vendor/atoum/atoum/ < tools/patches/atoum-4.1.0...4.2.0.patch || true"
"patch -f -p1 -d vendor/atoum/atoum/ < tools/patches/atoum-4.1.0...4.2.0.patch || true",
"patch -f -p1 -d vendor/michelf/php-markdown/ < tools/patches/php-markdown-php8-compat.patch || true"
],
"post-update-cmd": [
"@php -r \"file_put_contents('.composer.hash', sha1_file('composer.lock'));\"",
"@php -f vendor/bin/build_hw_jsons",
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-invalid-header-ignore.patch || true",
"patch -f -p1 -d vendor/laminas/laminas-mail/ < tools/patches/laminas-mail-address-no-length-check.patch || true",
"patch -f -p1 -d vendor/atoum/atoum/ < tools/patches/atoum-4.1.0...4.2.0.patch || true"
"patch -f -p1 -d vendor/atoum/atoum/ < tools/patches/atoum-4.1.0...4.2.0.patch || true",
"patch -f -p1 -d vendor/michelf/php-markdown/ < tools/patches/php-markdown-php8-compat.patch || true"
],
"build": [
"bin/console dependencies install && bin/console locales:compile"
Expand Down
13 changes: 13 additions & 0 deletions tools/patches/php-markdown-php8-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php
index 060a4ae..7fdbdbf 100644
--- a/Michelf/MarkdownExtra.php
+++ b/Michelf/MarkdownExtra.php
@@ -229,7 +229,7 @@ protected function doExtraAttributes($tag_name, $attr, $defaultIdValue = null, $
}

// Split on components
- preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr, $matches);
+ preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr ?? '', $matches);
$elements = $matches[0];

// Handle classes and IDs (only first ID taken into account)

0 comments on commit 8c3abf5

Please sign in to comment.