From c8f9bffa8870144329912399ac9a5ecea0c62826 Mon Sep 17 00:00:00 2001 From: Jakob Peters Date: Wed, 26 Jun 2024 07:46:09 -0700 Subject: [PATCH] Prefer to `show` `AbstractString`s with text mimes (#1114) `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. --- src/inline.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inline.jl b/src/inline.jl index 46a79818..2ef69587 100644 --- a/src/inline.jl +++ b/src/inline.jl @@ -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