mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 03:34:57 +08:00
Fix image uploads in Markdown cells (#945)
* Fix call to consume_uploaded_entries to match changes in LV * Escape reserved characters when inserting image in a Markdown cell
This commit is contained in:
parent
c0601798f3
commit
7fc8f24d2c
1 changed files with 7 additions and 4 deletions
|
@ -82,13 +82,16 @@ defmodule LivebookWeb.SessionLive.CellUploadComponent do
|
|||
filename = name <> ext
|
||||
destination_file = FileSystem.File.resolve(images_dir, filename)
|
||||
|
||||
with :ok <- FileSystem.File.copy(upload_file, destination_file) do
|
||||
{:ok, filename}
|
||||
end
|
||||
result =
|
||||
with :ok <- FileSystem.File.copy(upload_file, destination_file) do
|
||||
{:ok, filename}
|
||||
end
|
||||
|
||||
{:ok, result}
|
||||
end)
|
||||
|> case do
|
||||
[{:ok, filename}] ->
|
||||
src_path = "images/#{filename}"
|
||||
src_path = "images/#{URI.encode(filename, &URI.char_unreserved?/1)}"
|
||||
|
||||
{:noreply,
|
||||
socket
|
||||
|
|
Loading…
Add table
Reference in a new issue