Skip to content

Commit 6e51cb1

Browse files
jrfnlgrogy
authored andcommitted
Highlighter::lineNumbers(): bug fix - remove stray blank line at end of output
The `lineNumbers()` functionality adds a new line marker at the end of each line, including the last line, meaning that any code snippets being passed through this function will have a stray blank line at the end of the output. Fixed now.
1 parent d44defc commit 6e51cb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Highlighter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,6 @@ private function lineNumbers(array $lines, $markLine = null)
315315
$snippet .= $line . PHP_EOL;
316316
}
317317

318-
return $snippet;
318+
return rtrim($snippet, PHP_EOL);
319319
}
320320
}

0 commit comments

Comments
 (0)