Skip to content

Commit

Permalink
ensure JSONText is never base64-encoded (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Jun 2, 2023
1 parent a9ac21b commit 7d8bcc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function display_mimejson(mime_array::Vector{MIME}, x)
error("No displayable MIME types in mime array.")
end

display_mimejson(m::MIME, x) = (m, JSON.JSONText(limitstringmime(m, x)))
display_mimejson(m::MIME, x) = (m, JSON.JSONText(limitstringmime(m, x, true)))

"""
Generate a dictionary of `mime_type => data` pairs for all registered MIME
Expand Down
4 changes: 2 additions & 2 deletions src/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ InlineIOContext(io, KVs::Pair...) = IOContext(

# convert x to a string of type mime, making sure to use an
# IOContext that tells the underlying show function to limit output
function limitstringmime(mime::MIME, x)
function limitstringmime(mime::MIME, x, forcetext=false)
buf = IOBuffer()
if istextmime(mime)
if forcetext || istextmime(mime)
if israwtext(mime, x)
return String(x)
else
Expand Down

0 comments on commit 7d8bcc6

Please sign in to comment.