Skip to content

Commit 7d8bcc6

Browse files
authored
ensure JSONText is never base64-encoded (#1081)
1 parent a9ac21b commit 7d8bcc6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/display.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function display_mimejson(mime_array::Vector{MIME}, x)
8787
error("No displayable MIME types in mime array.")
8888
end
8989

90-
display_mimejson(m::MIME, x) = (m, JSON.JSONText(limitstringmime(m, x)))
90+
display_mimejson(m::MIME, x) = (m, JSON.JSONText(limitstringmime(m, x, true)))
9191

9292
"""
9393
Generate a dictionary of `mime_type => data` pairs for all registered MIME

src/inline.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ InlineIOContext(io, KVs::Pair...) = IOContext(
3434

3535
# convert x to a string of type mime, making sure to use an
3636
# IOContext that tells the underlying show function to limit output
37-
function limitstringmime(mime::MIME, x)
37+
function limitstringmime(mime::MIME, x, forcetext=false)
3838
buf = IOBuffer()
39-
if istextmime(mime)
39+
if forcetext || istextmime(mime)
4040
if israwtext(mime, x)
4141
return String(x)
4242
else

0 commit comments

Comments
 (0)