highlight

in lib/pygments/popen.rb [189:205]


    def highlight(code, opts={})
      
      
      return code if code.nil? || code.empty?

      
      opts[:options] ||= {}

      
      opts[:options][:outencoding] ||= 'utf-8'

      
      str = mentos(:highlight, nil, opts, code)
      str.force_encoding(opts[:options][:outencoding]) if str.respond_to?(:force_encoding)
      str
    end