Sha256: aeefcbc07f8d5d7c41f0870bf52e85f0f79f2152758b629bfe864e9d8d10855a

Contents?: true

Size: 312 Bytes

Versions: 125

Compression:

Stored size: 312 Bytes

Contents

module Gherkin
  module Formatter
    module Escaping
      # Escapes a pipes and backslashes:
      #
      # * | becomes \|
      # * \ becomes \\
      #
      # This is used in the pretty formatter.
      def escape_cell(s)
        s.gsub(/\|/, "\\|").gsub(/\\(?!\|)/, "\\\\\\\\")
      end
    end
  end
end

Version data entries

125 entries across 125 versions & 2 rubygems

Version Path
gherkin-2.2.0-i386-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.0-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.2.0-java lib/gherkin/formatter/escaping.rb
gherkin-2.1.5 lib/gherkin/formatter/escaping.rb
gherkin-2.1.5-i386-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.5-i386-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.5-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.1.5-java lib/gherkin/formatter/escaping.rb
gherkin-2.1.4 lib/gherkin/formatter/escaping.rb
gherkin-2.1.4-i386-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.4-i386-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.4-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.1.4-java lib/gherkin/formatter/escaping.rb
gherkin-2.1.3 lib/gherkin/formatter/escaping.rb
gherkin-2.1.3-i386-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.3-i386-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.1.3-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.1.3-java lib/gherkin/formatter/escaping.rb
gherkin-2.1.2 lib/gherkin/formatter/escaping.rb
gherkin-2.1.2-i386-mswin32 lib/gherkin/formatter/escaping.rb