Hi,
TL;DR
Edit crayon_langs.class.php, search for :
return preg_replace(‘/[^\w-+#]/msi’, ”, $id);
(should be around line 340)
Replace it with :
return preg_replace(‘/[^\w\-+#]/msi’, ”, $id);
Explanation :
PHP 7.3 handles regular expressions more strictly than older PHP version, due to the upgrade to PCRE2 library.
In a character class expression (between [] in the regexp), – is a special char, used for writing chars ranges, so it must be escaped.
PCRE1 was more tolerant, and considered – to be the – character when used in a context where the preceding data cannot be a start of range (\w is itself a group of chars, all alphanumeric chars plus underscore, so it cannot be a start of range).
See : https://stackoverflow.com/questions/24764212/preg-match-compilation-failed-invalid-range-in-character-class-at-offset
These are not the only things to change.
I need it for my test site, so i resumed this plugin to work on Php 7.4>, Gutenberg and last Wp:
https://www.axew3.com/w3/forums/viewtopic.php?f=10&t=1555