# markdown: Make highlighting of rendered markdown more accurate \(\#54744\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 25953912170719a6aab9762ea0ff7fe439b335f3

Requested commit: 25953912170719a6aab9762ea0ff7fe439b335f3

Commit: 25953912170719a6aab9762ea0ff7fe439b335f3

Tree: 8dbf8265e98d36aafb9dc873b58a2ebf3d1740d2

Author: Tim Vermeulen

Committer: GitHub

## Message

```
markdown: Make highlighting of rendered markdown more accurate (#54744)

Paints selections and search highlights of rendered markdown more
accurately, to properly match what's actually being selected.

Particularly noticeable when the selection spans multiple rows in a
table cell or when it starts right after a soft wrap.

|Before|After|
| --- | --- |
|<img width="831" height="677" alt="before"
src="https://github.com/user-attachments/assets/3b2c33be-e4cb-400f-9ba6-4163eb438f99"
/> | <img width="831" height="677" alt="after"
src="https://github.com/user-attachments/assets/04161dd8-7f4a-46c5-8c63-3497d3533f6d"
/> |


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

Release Notes:

- Fixed selection and search highlights in rendered markdown not always
being displayed accurately.
```

## Parents

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

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