Skip to content

ep: Fix code block extraction to require closing fence at line start - #46270

Merged
osyvokon merged 3 commits into
mainfrom
ep-fix-batching
Jan 7, 2026
Merged

ep: Fix code block extraction to require closing fence at line start#46270
osyvokon merged 3 commits into
mainfrom
ep-fix-batching

Conversation

@osyvokon

@osyvokon osyvokon commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

extract_last_codeblock was using find() to locate closing fences,
which would match backticks anywhere in the text. This caused incorrect
parsing when the content contained inline backticks or nested code
blocks, resulting in wrong diffs.

Fix by requiring the closing fence to be preceded by a newline.
Release Notes:

  • N/A

`extract_last_codeblock` was using `find()` to locate closing fences,
which would match backticks anywhere in the text. This caused incorrect
parsing when the content contained inline backticks or nested code
blocks, resulting in wrong diffs.

Fix by requiring the closing fence to be preceded by a newline.
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 7, 2026
@osyvokon
osyvokon enabled auto-merge (squash) January 7, 2026 16:41
@osyvokon
osyvokon merged commit 49c4dcb into main Jan 7, 2026
24 checks passed
@osyvokon
osyvokon deleted the ep-fix-batching branch January 7, 2026 16:52
rtfeldman pushed a commit that referenced this pull request Jan 9, 2026
…46270)

`extract_last_codeblock` was using `find()` to locate closing fences,
which would match backticks anywhere in the text. This caused incorrect
parsing when the content contained inline backticks or nested code
blocks, resulting in wrong diffs.

Fix by requiring the closing fence to be preceded by a newline.
Release Notes:

- N/A
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…ed-industries#46270)

`extract_last_codeblock` was using `find()` to locate closing fences,
which would match backticks anywhere in the text. This caused incorrect
parsing when the content contained inline backticks or nested code
blocks, resulting in wrong diffs.

Fix by requiring the closing fence to be preceded by a newline.
Release Notes:

- N/A
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ed-industries#46270)

`extract_last_codeblock` was using `find()` to locate closing fences,
which would match backticks anywhere in the text. This caused incorrect
parsing when the content contained inline backticks or nested code
blocks, resulting in wrong diffs.

Fix by requiring the closing fence to be preceded by a newline.
Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant