Skip to content

Formatter introduces escapes on standalone backslashesΒ #77

@kieran-ryan

Description

@kieran-ryan

πŸ‘“ What did you see?

Formatting escaped_pipes.feature in the gherkin parser's test data, the following diff is produced; with escapes introduced for standalone backslashes.

-       | \|Γ¦\\n     | \o\no\ |
+       | \|Γ¦\\n     | \\o\no\\ |

βœ… What did you expect to see?

New escape characters are not introduced.

       | \|Γ¦\\n     | \o\no\ |

πŸ“¦ Which tool/library version are you using?

node v18.16.0
gherkin-utils v9.0.0

πŸ”¬ How could we reproduce it?

Run the following in the gherkin parser repository

npm install @cucumber/gherkin-utils
npx @cucumber/gherkin-utils format gherkin/testdata/good/escaped_pipes.feature

πŸ“š Any additional context?

Unsure of appropriate behaviour in this case; and whether is desirable to be introducing these characters by the formatter. Perhaps is appropriate behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions