Skip to content

Commit

Permalink
Improve regex to handle code snippets "<" when using the syntax highl…
Browse files Browse the repository at this point in the history
…ighter block
  • Loading branch information
fjorgemota committed Aug 28, 2023
1 parent 511b5f6 commit 520c80b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntaxhighlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public function render_block( $attributes, $content ) {
}
}

$code = preg_replace( '#<pre [^>]+>([^<]+)?</pre>#', '$1', $content );
$code = preg_replace( '#<pre [^>]+>(.*)</pre>#s', '$1', $content );

// Undo escaping done by WordPress
$code = htmlspecialchars_decode( $code );
Expand Down

0 comments on commit 520c80b

Please sign in to comment.