Skip to content

Commit c45ab84

Browse files
authored
fix: unset variable by setting its value to nil (#5)
1 parent b9b1eab commit c45ab84

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/kino/excalidraw/options.ex

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ defmodule Kino.Excalidraw.Options do
5555
end
5656

5757
@option_names [:variable, "variable"]
58-
defp build_option({option, value}) when is_binary(value) when option in @option_names do
58+
defp build_option({option, value}) when is_binary(value) and option in @option_names do
59+
value = String.trim(value)
60+
5961
if Kino.SmartCell.valid_variable_name?(value) do
6062
[{:variable, value}]
6163
else
62-
[]
64+
[{:variable, nil}]
6365
end
6466
end
6567

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule KinoExcalidraw.MixProject do
22
use Mix.Project
33

4-
@version "0.4.0"
4+
@version "0.5.0"
55
@description "Excalidraw integration with Livebook"
66

77
def project do

0 commit comments

Comments
 (0)