Skip to content

Commit 9a840d7

Browse files
committed
Changed a bit the way PHP code is highlighted
1 parent 026d1a3 commit 9a840d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Renderers/CodeNodeRenderer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public function render(): string
7474
if ('text' !== $language) {
7575
$highLighter = new Highlighter();
7676
$code = $highLighter->highlight(self::LANGUAGES_MAPPING[$language] ?? $language, $code)->value;
77+
78+
// this allows to highlight the $ in PHP variable names
79+
$code = str_replace('<span class="hljs-variable">$', '<span class="hljs-variable"><span class="hljs-variable-other-marker">$</span>', $code);
7780
}
7881

7982
return $this->templateRenderer->render(

0 commit comments

Comments
 (0)