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>
90587dd639Ankan Misra committed on 6/26/2026, 1:31:47 PM· committed by GitHubparentdb30c67
2 files changedLine totals unavailable