TableCell with unescaped backslash is escaped in the AST value (original) (raw)
👓 What did you see?
While creating a prettier plugin for gherkin file, I found out that the TableCell with unescaped backslash is escaped in the AST.
Example from escaped_pipes.feature :
is reprensented in the AST like this:
{ "location": { "column": 22, "line": 10 }, "value": "\o\no\" }
So it's impossible to reconstitute the original string.
✅ What did you expect to see?
An unescaped backslash in the node value for unescaped backslash
📦 Which tool/library version are you using?
Javascript librairies :
- @cucumber/gherkin: 24.1.0"
- @cucumber/messages: 19.1.4
🔬 How could we reproduce it?
Probably run the cucumber test stack.
📚 Any additional context?
If this is intended, then how can we regenerate the original node value ?
According to https://cucumber.io/docs/gherkin/reference/#table-cell-escaping a backslash can not be alone (while not really explicitly said).
If the cucumber test data allow parsing this un-escaped backslash, is it a bug or a feature ? Some tool allow this comportment, like PHP library behat.
Thanks