def self.escape(input)
      result = input.dup.strip

      result.gsub!(/[&<>'"]/) do | match |
          case match