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.8-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.8-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.8-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.2.8-java lib/gherkin/formatter/escaping.rb
gherkin-2.2.7 lib/gherkin/formatter/escaping.rb
gherkin-2.2.7-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.7-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.7-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.2.7-java lib/gherkin/formatter/escaping.rb
gherkin-2.2.6 lib/gherkin/formatter/escaping.rb
gherkin-2.2.6-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.6-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.6-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.2.6-java lib/gherkin/formatter/escaping.rb
gherkin-2.2.5 lib/gherkin/formatter/escaping.rb
gherkin-2.2.5-x86-mswin32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.5-x86-mingw32 lib/gherkin/formatter/escaping.rb
gherkin-2.2.5-universal-dotnet lib/gherkin/formatter/escaping.rb
gherkin-2.2.5-java lib/gherkin/formatter/escaping.rb
gherkin-2.2.4 lib/gherkin/formatter/escaping.rb