diff --git a/lib/loofah.rb b/lib/loofah.rb index 5dbd2ec..20d3f33 100644 --- a/lib/loofah.rb +++ b/lib/loofah.rb @@ -7,14 +7,12 @@ class << self def html5_support? # Note that Loofah can only support HTML5 in Nokogiri >= 1.14.0 because it requires the # subclassing fix from https://github.com/sparklemotion/nokogiri/pull/2534 - unless @html5_support_set - @html5_support = ( - Gem::Version.new(Nokogiri::VERSION) > Gem::Version.new("1.14.0") && + return @html5_support if defined? @html5_support + + @html5_support = ( + Gem::Version.new(Nokogiri::VERSION) > Gem::Version.new("1.14.0") && Nokogiri.uses_gumbo? - ) - @html5_support_set = true - end - @html5_support + ) end end end