class Capybara::Selector::CSS
def self.escape(str)
def self.escape(str) value = str.dup out = +'' out << value.slice!(0...1) if value =~ /^[-_]/ out << (value[0] =~ NMSTART ? value.slice!(0...1) : escape_char(value.slice!(0...1))) out << value.gsub(/[^a-zA-Z0-9_-]/) { |char| escape_char char } out end
def self.escape_char(char)
def self.escape_char(char) char =~ %r{[ -/:-~]} ? "\\#{char}" : format('\\%06x', char.ord) end
def self.split(css)
def self.split(css) Splitter.new.split(css) end