crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

Fix compatibility with PHP 7.3

Open felixonmars opened this issue 6 years ago • 8 comments

The regex fails to parse in PHP 7.3, which broke the page in later functions.

PHP Warning:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in /var/www/felixcat/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

felixonmars avatar Dec 09 '18 19:12 felixonmars

@felixonmars - don't suppose you have Crayon working with WP 5.0?

willstocks avatar Dec 11 '18 11:12 willstocks

Indeed, I am running Crayon with WP 5.0 under PHP 7.3.

felixonmars avatar Dec 11 '18 19:12 felixonmars

Interesting!

I’m still on PHP 7.2 at the mo but running WP 5.0!

How are declaring language options in the blocks? I only realised through fiddling this evening that when I add a code block, it is formatted by Crayon on the front-end, but I’ve not yet found a way to declare which language I’m writing!

On Tue, 11 Dec 2018 at 19:03, Felix Yan [email protected] wrote:

Indeed, I am running Crayon with WP 5.0 under PHP 7.3.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aramk/crayon-syntax-highlighter/pull/451#issuecomment-446321386, or mute the thread https://github.com/notifications/unsubscribe-auth/Apt9Ah5CgTQM-5m6h3D8tAGomZBNzFbyks5u4AFtgaJpZM4ZKSDA .

willstocks avatar Dec 12 '18 00:12 willstocks

I've been using <pre lang="python"> or <pre class="lang:python"> for that.

felixonmars avatar Dec 12 '18 08:12 felixonmars

Brilliant! Are you just wrapping it manually by "Edit block as HTML"?

willstocks avatar Dec 12 '18 11:12 willstocks

Yes.

felixonmars avatar Dec 12 '18 15:12 felixonmars

perfect ,!

bollwarm avatar Aug 22 '19 03:08 bollwarm

Is this ever gonna be released? I spent a lot of time today to figure out the same issue before finding this.

gilvegliach avatar Oct 24 '20 23:10 gilvegliach