Skip to content

Commit

Permalink
Prefer to show AbstractStrings with text mimes (#1114)
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 authored Jun 26, 2024
1 parent af0a1f8 commit c8f9bff
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 c8f9bff

Please sign in to comment.