ZIm/crates/html_to_markdown/src
Cole Miller 5b61b8c8ed
agent: Fix crash with pathological fetch output (#34253)
Closes #34029

The crash is due to a stack overflow in our `html_to_markdown`
conversion; I've added a maximum depth of 200 for the recursion in that
crate to guard against this kind of thing.

Separately, we were treating all content-types other than `text/plain`
and `application/json` as HTML; I've changed this to only treat
`text/html` and `application/xhtml+xml` as HTML, and fall back to
plaintext. (In the original crash, the content-type was
`application/octet-stream`.)

Release Notes:

- agent: Fixed a potential crash when fetching large non-HTML files.
2025-07-11 21:01:09 -04:00
..
structure chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
html_element.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
html_to_markdown.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
markdown.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
markdown_writer.rs agent: Fix crash with pathological fetch output (#34253) 2025-07-11 21:01:09 -04:00
structure.rs Move rustdoc-related code to rustdoc crate (#12945) 2024-06-12 15:53:05 -04:00