You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

escaping.rb 416 B

2 years ago
12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module Cucumber
  3. module Gherkin
  4. module Formatter
  5. module Escaping
  6. # Escapes a pipes and backslashes:
  7. #
  8. # * | becomes \|
  9. # * \ becomes \\
  10. #
  11. # This is used in the pretty formatter.
  12. def escape_cell(sym)
  13. sym.gsub(/\\(?!\|)/, '\\\\\\\\').gsub(/\n/, '\\n').gsub(/\|/, '\\|')
  14. end
  15. end
  16. end
  17. end
  18. end

No Description

Contributors (1)