Skip to content

Commit

Permalink
Fix SQL syntax highlight on Symfony 6.3 (#1680)
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed Jun 28, 2023
1 parent 96ffb1a commit 80d2b43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Resources/views/Collector/db.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@
.time-bar { display: block; position: absolute; top: 0; left: 0; bottom: 0; background: #e0e0e0; }
.sql-runnable.sf-toggle-content.sf-toggle-visible { display: flex; flex-direction: column; }
.sql-runnable button { align-self: end; }
{% if profiler_markup_version >= 3 %}
.highlight .keyword { color: var(--highlight-keyword); font-weight: bold; }
.highlight .word { color: var(--color-text); }
.highlight .variable { color: var(--highlight-variable); }
.highlight .symbol { color: var(--color-text); }
.highlight .comment { color: var(--highlight-comment); }
.highlight .string { color: var(--highlight-string); }
.highlight .number { color: var(--highlight-constant); font-weight: bold; }
.highlight .error { color: var(--highlight-error); }
{% endif %}
</style>

<h2>Query Metrics</h2>
Expand Down
1 change: 1 addition & 0 deletions Tests/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public function testRender(): void
'profile' => $profile,
'collector' => $this->collector,
'queries' => $this->debugDataHolder->getData(),
'profiler_markup_version' => 3,
]);

$expectedEscapedSql = 'SELECT&#x0A;&#x20;&#x20;&#x2A;&#x0A;FROM&#x0A;&#x20;&#x20;foo&#x0A;WHERE&#x0A;&#x20;&#x20;bar&#x20;IN&#x20;&#x28;&#x3F;,&#x20;&#x3F;&#x29;&#x0A;&#x20;&#x20;AND&#x20;&quot;&quot;&#x20;&gt;&#x3D;&#x20;&quot;&quot;';
Expand Down

0 comments on commit 80d2b43

Please sign in to comment.