def target_extension
      return @target_extension if @target_extension

      if type = MIME::Types[self.target_mime_type].first
        # Dirty little hack to enforce the use of .html instead of .htm
        if type.sub_type == "html"
          @target_extension = "html"
        else
          @target_extension = type.extensions.first
        end
      else
        @target_extension = File.extname(self.source_path.to_s).sub(/^\./, "")
      end
    end
def target_extension
      return @target_extension if @target_extension

      if type = MIME::Types[self.target_mime_type].first
        # Dirty little hack to enforce the use of .html instead of .htm
        if type.sub_type == "html"
          @target_extension = "html"
        else
          @target_extension = type.extensions.first
        end
      else
        @target_extension = File.extname(self.source_path.to_s).sub(/^\./, "")
      end
    end
Try to infer the final extension of the output file.