Skip to content

Commit

Permalink
Fix quote bug in dashboard highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Oct 26, 2023
1 parent ae28ad1 commit e38afbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/realtime-compiler/src/Http/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public static function isMediaFileProbablyMinified(string $contents): bool
public static function highlightMediaLibraryCode(string $contents): HtmlString
{
$contents = e($contents);
$contents = str_replace([''', '"'], ['%SQT%', '%DQT%'], $contents); // Temporarily replace escaped quotes

if (static::isMediaFileProbablyMinified($contents)) {
return new HtmlString(substr($contents, 0, 800));
Expand Down Expand Up @@ -215,6 +216,8 @@ public static function highlightMediaLibraryCode(string $contents): HtmlString
return rtrim($line);
})->implode("\n");

$highlighted = str_replace(['%SQT%', '%DQT%'], [''', '"'], $highlighted);

return new HtmlString($highlighted);
}

Expand Down

0 comments on commit e38afbd

Please sign in to comment.