mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-07 20:26:10 +08:00
Remove trailing newline in captured outputs (#111)
* Remove trailing newline in captured outputs * Use String.replace_suffix/3
This commit is contained in:
parent
af79a0fd2f
commit
ad99680a82
1 changed files with 3 additions and 0 deletions
|
|
@ -222,6 +222,9 @@ defmodule LivebookWeb.CellComponent do
|
|||
end
|
||||
|
||||
defp render_output(output, id) when is_binary(output) do
|
||||
# Captured output usually has a trailing newline that we can ignore,
|
||||
# because each line is itself a block anyway.
|
||||
output = String.replace_suffix(output, "\n", "")
|
||||
lines = ansi_to_html_lines(output)
|
||||
assigns = %{lines: lines, id: id}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue