Skip to content

Escape pipe characters when rendering table cells - #204

Merged
bischoffdev merged 1 commit into
trivago:mainfrom
ivanjensen-ep:203-escaped-pipe-table-cells
Jul 27, 2026
Merged

bischoffdev merged 1 commit into
trivago:mainfrom
ivanjensen-ep:203-escaped-pipe-table-cells

Conversation

@ivanjensen-ep

Copy link
Copy Markdown
Contributor

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.

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
bischoffdev merged commit 2a5151e into trivago:main Jul 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Escaped pipes (\|) in tables cause scenarios to be silently dropped

2 participants