marathon-core/ruby-selenium-webdriver/src/main/resources/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/remote/w3c/bridge.rb
# Escapes invalid characters in CSS selector.
# @see https://mathiasbynens.be/notes/css-escapes
Escapes invalid characters in CSS selector.
Escapes invalid characters in CSS selector .
def escape_css(string)
            string = string.gsub(ESCAPE_CSS_REGEXP) { |match| "\\#{match}" }
            if !string.empty? && string[0] =~ /[[:digit:]]/
              string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..-1]}"
            end
            string
          end
def escape_css ( string ) string = string . gsub ( ESCAPE_CSS_REGEXP ) { | match | "\\#{match}" } if ! string . empty? && string [ 0 ] =~ / [[:digit:]] / string = "\\#{UNICODE_CODE_POINT + Integer(string[0])} #{string[1..-1]}" end string end
Escapes invalid characters in CSS selector.
Escapes invalid characters in CSS selector .
string
see
None