diff --git a/lib/iruby/display.rb b/lib/iruby/display.rb index fb392b0..98c638b 100644 --- a/lib/iruby/display.rb +++ b/lib/iruby/display.rb @@ -106,14 +106,15 @@ 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) if FORCE_TEXT_TYPES.include?(mime) true else - MIME::Type.new("content-type" => mime).ascii? + MIME::Types[mime].first.ascii? end end