Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter introduces escapes on standalone backslashes #77

Open
kieran-ryan opened this issue Apr 16, 2024 · 1 comment
Open

Formatter introduces escapes on standalone backslashes #77

kieran-ryan opened this issue Apr 16, 2024 · 1 comment
Labels
🐛 bug Defect / Bug

Comments

@kieran-ryan
Copy link
Sponsor Member

kieran-ryan commented Apr 16, 2024

👓 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?

@kieran-ryan kieran-ryan added the 🐛 bug Defect / Bug label Apr 16, 2024
@mpkorstanje
Copy link
Contributor

Is this caused by the formatter or does the parser render the double slashes?

@kieran-ryan kieran-ryan changed the title Escape introduced by formatter on standalone backslashes Formatting introduces escapes on standalone backslashes Apr 23, 2024
@kieran-ryan kieran-ryan changed the title Formatting introduces escapes on standalone backslashes Formatter introduces escapes on standalone backslashes Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

2 participants