Don't format elements with whitespace-pre

This commit is contained in:
Jonatan Kłosko 2022-08-02 18:22:49 +02:00
parent 3fcb6b97bb
commit 4206e84682
2 changed files with 10 additions and 8 deletions

View file

@ -100,9 +100,12 @@ defmodule LivebookWeb.Output do
assigns = %{message: formatted} assigns = %{message: formatted}
~H""" ~H"""
<div class="whitespace-pre-wrap font-editor text-gray-500" role="complementary" aria-label="error"> <div
<%= ansi_string_to_html(@message) %> class="whitespace-pre-wrap font-editor text-gray-500"
</div> role="complementary"
aria-label="error"
phx-no-format
><%= ansi_string_to_html(@message) %></div>
""" """
end end
@ -135,9 +138,8 @@ defmodule LivebookWeb.Output do
class="whitespace-pre-wrap font-editor text-red-600" class="whitespace-pre-wrap font-editor text-red-600"
role="complementary" role="complementary"
aria-label="error message" aria-label="error message"
> phx-no-format
<%= @message %> ><%= @message %></div>
</div>
""" """
end end
end end

View file

@ -21,8 +21,8 @@ defmodule LivebookWeb.Output.TextComponent do
class="overflow-auto whitespace-pre font-editor text-gray-500 tiny-scrollbar" class="overflow-auto whitespace-pre font-editor text-gray-500 tiny-scrollbar"
id={"virtualized-text-#{@id}-content"} id={"virtualized-text-#{@id}-content"}
phx-update="ignore" phx-update="ignore"
> phx-no-format
</div> ></div>
<div class="absolute right-2 top-0 z-10"> <div class="absolute right-2 top-0 z-10">
<button <button
class="icon-button bg-gray-100" class="icon-button bg-gray-100"