module Cucumber::Gherkin::Formatter::Escaping

def escape_cell(sym)

This is used in the pretty formatter.

* \ becomes \\
* | becomes \|

Escapes a pipes and backslashes:
def escape_cell(sym)
  sym.gsub(/\\(?!\|)/, '\\\\\\\\').gsub(/\n/, '\\n').gsub(/\|/, '\\|')
end