Sha256: 633644b4f9322c10700e873b62a9a658cb74d6ab61b0b2d4b742202a6dce004c

Contents?: true

Size: 711 Bytes

Versions: 33

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: false
#--
# htmlutils.rb -- HTMLUtils Module
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: htmlutils.rb,v 1.7 2002/09/21 12:23:35 gotoyuzo Exp $

module WEBrick
  module HTMLUtils

    ##
    # Escapes &, ", > and < in +string+

    def escape(string)
      return "" unless string
      str = string.b
      str.gsub!(/&/n, '&amp;')
      str.gsub!(/\"/n, '&quot;')
      str.gsub!(/>/n, '&gt;')
      str.gsub!(/</n, '&lt;')
      str.force_encoding(string.encoding)
    end
    module_function :escape

  end
end

Version data entries

33 entries across 27 versions & 6 rubygems

Version Path
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb