Module: Cucumber::Gherkin::Formatter::Escaping
- Included in:
- Formatter::LegacyApi::Adapter::ExamplesTablePrinter::LegacyTable::FindMaxWidth, Formatter::Pretty, MultilineArgument::DataTable::Cells
- Defined in:
- lib/cucumber/gherkin/formatter/escaping.rb
Instance Method Summary collapse
-
#escape_cell(s) ⇒ Object
Escapes a pipes and backslashes:.
Instance Method Details
#escape_cell(s) ⇒ Object
Escapes a pipes and backslashes:
-
| becomes |
-
\ becomes \
This is used in the pretty formatter.
13 14 15 |
# File 'lib/cucumber/gherkin/formatter/escaping.rb', line 13 def escape_cell(s) s.gsub(/\\(?!\|)/, '\\\\\\\\').gsub(/\n/, '\\n').gsub(/\|/, '\\|') end |