Skip to content

Commit

Permalink
Preserve line numbering in older php versions
Browse files Browse the repository at this point in the history
Signed by Shawn Bulen, [email protected]
  • Loading branch information
sbulen committed Oct 8, 2024
1 parent d68decb commit 9002bb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/BBCodeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ public static function highlightPhpCode(string $code): string

// Remove line breaks inserted before & after the actual code in php < 8.3
$buffer = preg_replace('/^(<span\s[^>]*>)<br \/>/', '$1', $buffer);
$buffer = preg_replace('/<br \/>(<span\s[^>]*>)<br \/>$/', '$1', $buffer);
$buffer = preg_replace('/<br \/>(<\/span[^>]*>)<br \/>$/', '$1', $buffer);

return strtr($buffer, ['\'' => '&#039;']);
}
Expand Down

0 comments on commit 9002bb3

Please sign in to comment.