From 4f3cf5f34e2b6f5f85085a37cac84d9a24681c4e Mon Sep 17 00:00:00 2001 From: Andrew Mackross Date: Thu, 26 Dec 2024 19:51:22 +1300 Subject: [PATCH 1/2] Fix printed warning from MIME::Types --- lib/iruby/display.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iruby/display.rb b/lib/iruby/display.rb index fb392b0..8c9a57c 100644 --- a/lib/iruby/display.rb +++ b/lib/iruby/display.rb @@ -113,7 +113,7 @@ def ascii?(mime) if FORCE_TEXT_TYPES.include?(mime) true else - MIME::Type.new("content-type" => mime).ascii? + MIME::Types[mime].first.ascii? end end From 2207ac6d1773396e7e8590504da74c61d0356dac Mon Sep 17 00:00:00 2001 From: Andrew Mackross Date: Mon, 30 Dec 2024 12:54:15 +1300 Subject: [PATCH 2/2] Update display.rb --- lib/iruby/display.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/iruby/display.rb b/lib/iruby/display.rb index 8c9a57c..98c638b 100644 --- a/lib/iruby/display.rb +++ b/lib/iruby/display.rb @@ -106,7 +106,8 @@ def protect(mime, data) # but mime-types library tells us it is a non-text type. FORCE_TEXT_TYPES = Set[ "application/javascript", - "image/svg+xml" + "image/svg+xml", + "text.html", ].freeze def ascii?(mime)