Skip to content

Fix escaped trailing pipes being removed from table cells - #725

Merged
nicholasserra merged 2 commits into
trentm:masterfrom
walitemuri:codex/preserve-escaped-table-pipes
Sep 14, 2026
Merged

nicholasserra merged 2 commits into
trentm:masterfrom
walitemuri:codex/preserve-escaped-table-pipes

Conversation

@walitemuri

Copy link
Copy Markdown
Contributor

With the tables extra, an escaped pipe at the end of a row is stripped as if it were the optional closing table border. For example:

Name | Operator \|
--- | ---
or | \|

The heading renders as Operator \ and the data cell as \, instead of Operator | and |. _split_row now preserves an escaped final pipe so the existing cell unescaping can handle it.

The regression fixture covers headers and body rows, optional leading/trailing borders, repeated escaped pipes, alignment, emphasis, and empty cells. It fails before the implementation change and passes afterward.

Validation on macOS with Python 3.13 and all optional dependencies installed:

  • cd test && ../.venv/bin/python test.py -- -knownfailure: 270 tests pass. The runner retains its standard known-failure and Pygments-version exclusions.
  • .venv/bin/python test/test_redos.py: all 7 checks pass.
  • pycodestyle --diff for the changed Python lines and git diff --check: pass.

Prepared with OpenAI Codex assistance.

@nicholasserra

Copy link
Copy Markdown
Collaborator

Thanks! If you can go in and fix the CHANGES format i'll hit merge

@walitemuri

Copy link
Copy Markdown
Contributor Author

Fixed

@nicholasserra

Copy link
Copy Markdown
Collaborator

Thanks!

@nicholasserra
nicholasserra merged commit ba92f30 into trentm:master Sep 14, 2026
18 checks 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.

2 participants