Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4: (21 commits)
  [SecurityBundle] Add `provider` XML attribute to the authenticators it’s missing from
  [DoctrineBridge] Test reset with a true manager
  Sync php-cs-fixer config file with 7.2
  [HttpClient] Fix parsing SSE
  [Notifier] Fix thread key in GoogleChat bridge
  [HttpKernel][Security] Fix accessing session for stateless request
  [Serializer] Fix `ObjectNormalizer` with property path
  test handling of special "value" constraint option
  [PhpUnitBridge] Add missing import
  [FrameworkBundle] Fix setting default context for certain normalizers
  [57251] Missing translations for Romanian (ro)
  [ErrorHandler] Fix rendered exception code highlighting on PHP 8.3
  [String] Fix #54611 pluralization of -on ending words + singularization of -a ending foreign words
  [Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message
  [Messenger] Comply with Amazon SQS requirements for message body
  fix cssColor HSLA test dataProvider
  properly handle invalid data for false/true types
  chore: upgrade class doc
  add space in error message
  [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
  ...
  • Loading branch information
xabbuh committed Jun 21, 2024
2 parents 57de1b7 + d7b10da commit 9bcb264
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Extension/CodeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ public function fileExcerpt(string $file, int $line, int $srcContext = 3): ?stri
if (\PHP_VERSION_ID >= 80300) {
// remove main pre/code tags
$code = preg_replace('#^<pre.*?>\s*<code.*?>(.*)</code>\s*</pre>#s', '\\1', $code);
// split multiline code tags
$code = preg_replace_callback('#<code ([^>]++)>((?:[^<]*+\\n)++[^<]*+)</code>#', fn ($m) => "<code $m[1]>".str_replace("\n", "</code>\n<code $m[1]>", $m[2]).'</code>', $code);
// Convert spaces to html entities to preserve indentation when rendered
$code = str_replace(' ', '&nbsp;', $code);
// split multiline span tags
$code = preg_replace_callback('#<span ([^>]++)>((?:[^<\\n]*+\\n)++[^<]*+)</span>#', function ($m) {
return "<span $m[1]>".str_replace("\n", "</span>\n<span $m[1]>", $m[2]).'</span>';
}, $code);
$content = explode("\n", $code);
} else {
// remove main code/span tags
Expand Down

0 comments on commit 9bcb264

Please sign in to comment.