Skip to content

Commit

Permalink
Highlighter::lineNumbers(): bug fix - remove stray blank line at end …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
jrfnl authored and grogy committed Feb 4, 2022
1 parent d44defc commit 6e51cb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,6 @@ private function lineNumbers(array $lines, $markLine = null)
$snippet .= $line . PHP_EOL;
}

return $snippet;
return rtrim($snippet, PHP_EOL);
}
}

0 comments on commit 6e51cb1

Please sign in to comment.