From 432daf770215c0438aa126c75fb5f89b0d303d0b Mon Sep 17 00:00:00 2001 From: Jakob Peters Date: Mon, 20 May 2024 13:14:53 -0700 Subject: [PATCH] Prefer to `show` `AbstractString`s with text mimes `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