We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
code
1 parent 85a4a8f commit d4d8751Copy full SHA for d4d8751
lib/runner.php
@@ -154,9 +154,9 @@ function fix_newlines( $text ) {
154
155
// Replace newline characters within 'code' and 'pre' tags with replacement string.
156
$text = preg_replace_callback(
157
- "/(?<=<pre><code>)(.+)(?=<\/code><\/pre>)/s",
+ "/(<pre><code[^>]*>)(.+)(?=<\/code><\/pre>)/sU",
158
function ( $matches ) use ( $replacement_string ) {
159
- return preg_replace( '/[\n\r]/', $replacement_string, $matches[1] );
+ return preg_replace( '/[\n\r]/', $replacement_string, $matches[1] . $matches[2] );
160
},
161
$text
162
);
0 commit comments