Skip to content

Commit

Permalink
Prefer to show AbstractStrings with text mimes
Browse files Browse the repository at this point in the history
`israwtext` assumed that an `AbstractString` with a text MIME was
already in the requested format. Instead, only assume this if the string
is not otherwise `showable`. This enables customizing the display of
`AbstractString`s.
  • Loading branch information
jakobjpeters committed May 20, 2024
1 parent 1855336 commit 432daf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ipy_mime = [
# need special handling for showing a string as a textmime
# type, since in that case the string is assumed to be
# raw data unless it is text/plain
israwtext(::MIME, x::AbstractString) = true
israwtext(m::MIME, x::AbstractString) = !showable(m, x)
israwtext(::MIME"text/plain", x::AbstractString) = false
israwtext(::MIME, x) = false

Expand Down

0 comments on commit 432daf7

Please sign in to comment.