")
- end)
- end
-
@doc """
Renders a component inside the `LiveBook.ModalComponent` component.
diff --git a/lib/live_book_web/live/cell.ex b/lib/live_book_web/live/cell.ex
index 1f3234bcb..a9d3ec409 100644
--- a/lib/live_book_web/live/cell.ex
+++ b/lib/live_book_web/live/cell.ex
@@ -151,18 +151,15 @@ defmodule LiveBookWeb.Cell do
"""
end
- defp render_output({:ok, value}) do
- inspected = inspect_as_html(value, pretty: true, width: 100)
-
- assigns = %{inspected: inspected}
+ defp render_output({:inspect_html, inspected_html}) do
+ assigns = %{inspected_html: inspected_html}
~L"""
- <%= @inspected %>
+ <%= raw @inspected_html %>
"""
end
- defp render_output({:error, kind, error, stacktrace}) do
- formatted = Exception.format(kind, error, stacktrace)
+ defp render_output({:error, formatted}) do
assigns = %{formatted: formatted}
~L"""
diff --git a/test/live_book/evaluator/string_formatter_test.exs b/test/live_book/evaluator/string_formatter_test.exs
new file mode 100644
index 000000000..f41d31a5e
--- /dev/null
+++ b/test/live_book/evaluator/string_formatter_test.exs
@@ -0,0 +1,19 @@
+defmodule LiveBook.Evaluator.StringFormatterTest do
+ use ExUnit.Case, async: true
+
+ alias LiveBook.Evaluator.StringFormatter
+
+ doctest StringFormatter
+
+ describe "inspect_as_html/2" do
+ test "uses span tags for term highlighting" do
+ assert ~s{[1, 2]} ==
+ StringFormatter.inspect_as_html([1, 2])
+ end
+
+ test "escapes HTML in the inspect result" do
+ assert ~s{"1 < 2"} ==
+ StringFormatter.inspect_as_html("1 < 2")
+ end
+ end
+end
diff --git a/test/live_book/runtime/erl_dist/manager_test.exs b/test/live_book/runtime/erl_dist/manager_test.exs
index e730d18ca..649232476 100644
--- a/test/live_book/runtime/erl_dist/manager_test.exs
+++ b/test/live_book/runtime/erl_dist/manager_test.exs
@@ -34,7 +34,7 @@ defmodule LiveBook.Runtime.ErlDist.ManagerTest do
Manager.set_owner(node(), self())
Manager.evaluate_code(node(), "1 + 1", :container1, :evaluation1)
- assert_receive {:evaluation_response, :evaluation1, {:ok, 2}}
+ assert_receive {:evaluation_response, :evaluation1, _}
Manager.stop(node())
end
diff --git a/test/live_book_web/helpers_test.exs b/test/live_book_web/helpers_test.exs
deleted file mode 100644
index 24161c8eb..000000000
--- a/test/live_book_web/helpers_test.exs
+++ /dev/null
@@ -1,20 +0,0 @@
-defmodule LiveBookWeb.HelpersTest do
- use ExUnit.Case, async: true
-
- alias LiveBookWeb.Helpers
-
- doctest Helpers
-
- describe "inspect_as_html/2" do
- test "uses span tags for term highlighting" do
- assert {:safe,
- ~s{[1, 2]}} ==
- Helpers.inspect_as_html([1, 2])
- end
-
- test "escapes HTML in the inspect result" do
- assert {:safe, ~s{"1 < 2"}} ==
- Helpers.inspect_as_html("1 < 2")
- end
- end
-end