Repository navigation
Escape pipe characters when rendering table cells - #204
Merged
bischoffdev merged 1 commit intoJul 27, 2026
Merged
Conversation
The Gherkin parser unescapes "\|" to a literal "|" when reading a source feature. When Cucable wrote that value back into a generated "| ... |" row it was not re-escaped, so the pipe was read as an extra column separator. The generated feature then failed to parse with "inconsistent cell count within the table" and the scenario was silently dropped. Re-escape "|" as "\|" when rendering data table and examples cells. Fixes trivago#203
bischoffdev
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #203
The Gherkin parser unescapes
\|to a literal|when reading a source feature. Cucable wrote that value back into the generated| ... |row without re-escaping, so the pipe was read as an extra column separator. The generated feature then failed to parse with "inconsistent cell count within the table" and the scenario was silently dropped.Re-escape
|as\|when rendering data table and examples cells.Added a round-trip test in
FeatureFileContentRendererTest: a rendered data table with a pipe in a cell value now re-parses cleanly.