Skip to content

Commit

Permalink
split multiline string into vector of one-liners (#10)
Browse files Browse the repository at this point in the history
this is needed for image/svg+xml and text/html, fix #8
  • Loading branch information
fredrikekre committed May 17, 2018
1 parent 5143749 commit a34a1b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Literate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,14 @@ function execute_notebook(nb)
execute_result["output_type"] = "execute_result"
execute_result["metadata"] = Dict()
execute_result["execution_count"] = execution_count
execute_result["data"] = IJulia.display_dict(r)
dd = IJulia.display_dict(r)
# we need to split some mime types into vectors of lines instead of a single string
for mime in ("image/svg+xml", "text/html")
if haskey(dd, mime)
dd[mime] = collect(Any, eachline(IOBuffer(dd[mime]), chomp = false))
end
end
execute_result["data"] = dd

push!(cell["outputs"], execute_result)
end
Expand Down

0 comments on commit a34a1b1

Please sign in to comment.