# markdown: Skip linkify inside code blocks \(\#52762\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3e0a0e1dd59611a3b8806fca871023e8a02f57aa

Requested commit: 3e0a0e1dd59611a3b8806fca871023e8a02f57aa

Commit: 3e0a0e1dd59611a3b8806fca871023e8a02f57aa

Tree: 27c0847d2d94cf6657d0fddfe7c11e780933c66c

Author: Smit Barmase

Committer: GitHub

## Message

```
markdown: Skip linkify inside code blocks (#52762)

Profiling streamed agent responses showed `parse_markdown_with_options`
consuming ~50% of CPU cycles. The hot path is `LinkFinder` scanning
every `Text` event, including code block content, where detected URLs
are never rendered as links.

In the profiled case, the markdown had 235k+ URLs inside code blocks,
making linkify extremely costly per-parse. This PR short-circuits the
text-merging + linkify path for code block content.

Release Notes:

- N/A
```

## Parents

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

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