Sha256: a0323871a16eea53cebd93332640cd802975e3bd3606dd7f83d4021c6f873a64
Contents?: true
Size: 381 Bytes
Versions: 5
Compression:
Stored size: 381 Bytes
Contents
# frozen_string_literal: true module Cucumber 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(/\n/, '\\n').gsub(/\|/, '\\|') end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems