# Keep inline code pipes inside markdown table cells \(\#57744\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/90587dd639644f338fda648628bfde4b45bbed1d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 90587dd639644f338fda648628bfde4b45bbed1d

Requested commit: 90587dd639644f338fda648628bfde4b45bbed1d

Commit: 90587dd639644f338fda648628bfde4b45bbed1d

Tree: e8515ecc644a2ca3b08759bfa4d7982964db3a06

Author: Ankan Misra

Committer: GitHub

## Message

```
Keep inline code pipes inside markdown table cells (#57744)

## Summary

Fixes markdown table rendering when inline code spans contain pipe
characters. Code such as `` `a|b` `` and `` `a||b` `` now stays in one
table cell instead of being split into extra columns.

## Why

Agent output and markdown previews can include regexes, shell snippets,
and other code spans with `|` characters inside tables. Before this
change, those pipes could be parsed as table delimiters even though they
were part of inline code.

## Changes

- Masks raw pipes only inside matched inline code spans before
`pulldown-cmark` parses tables.
- Restores rendered code-span text from the original source range,
including escaped table pipes.
- Avoids masking unmatched backticks, fenced code blocks, indented code
blocks, and invalid fence closers.
- Adds parser and renderer coverage for raw pipes, escaped pipes,
unmatched inline code, invalid fences, and code-span link callbacks.

Manual check: generated agent responses across multiple models render
tables containing `` `a|b` ``, `` `(a|b)` ``, and `` `a||b` `` as single
code-span cells rather than split columns.

## Screenshots / Recordings

| Before | After |
| --- | --- |
| <img width="702" height="532" alt="Before"
src="https://github.com/user-attachments/assets/f9b7606f-15d5-41bc-980c-5e26337f9be4">
| <img width="846" height="536" alt="After"
src="https://github.com/user-attachments/assets/60a7a9bf-8417-4146-ac37-0725dd8b4e3c">
|

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #57683

Release Notes:

- Fixed markdown table rendering for inline code spans that contain pipe
characters.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Tom Houlé <tom@tomhoule.com>
```

## Parents

- [db30c67ed254ee703399ea862cfc6acf33332b09](https://git.cafe/gitcafe/zed/commit/db30c67ed254ee703399ea862cfc6acf33332b09?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/90587dd639644f338fda648628bfde4b45bbed1d?format=markdown)
