Skip to content

Commit

Permalink
Refactor gutter injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nimah79 committed Aug 30, 2024
1 parent d6b0013 commit a3b2079
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Languages/Base/Injections/GutterInjection.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ public function parse(string $content, Highlighter $highlighter): ParsedInjectio
$gutterClass = 'hl-gutter' . ($hasClasses ? ' ' . $hasClasses : '');

$lines[$i] = sprintf(
Escape::tokens('<span class="%s">%s</span>'.($highlighter->getTheme() instanceof TerminalTheme ? ' ' : '').'%s'),
Escape::tokens('<span class="%s">%s</span>%s%s'),
$gutterClass,
str_pad(
string: (string) $gutterNumber,
length: $gutterWidth,
pad_type: STR_PAD_LEFT,
),
$highlighter->getTheme() instanceof TerminalTheme ? ' ' : '',
$line,
);
}
Expand Down

0 comments on commit a3b2079

Please sign in to comment.