From 520c80b1c75e9453a7eb93dd70ac7a9f458e62a8 Mon Sep 17 00:00:00 2001 From: Fernando Jorge Mota Date: Thu, 24 Aug 2023 19:45:15 -0300 Subject: [PATCH] Improve regex to handle code snippets "<" when using the syntax highlighter block --- syntaxhighlighter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntaxhighlighter.php b/syntaxhighlighter.php index 2b2c057..f3f1085 100644 --- a/syntaxhighlighter.php +++ b/syntaxhighlighter.php @@ -554,7 +554,7 @@ public function render_block( $attributes, $content ) { } } - $code = preg_replace( '#
]+>([^<]+)?
#', '$1', $content ); + $code = preg_replace( '#
]+>(.*)
#s', '$1', $content ); // Undo escaping done by WordPress $code = htmlspecialchars_decode( $code );