Files
zed/crates/markdown_preview/Cargo.toml
T
Smit Barmase c56dcef972 markdown_preview: Fix panic in mermaid diagram renderer (#50176)
The mermaid renderer can fail to render certain diagrams, and we already
have a fallback for that. It's not worth crashing Zed over it.

Wrapping `catch_unwind` alone doesn't work because our panic hooks
terminate the process before unwinding begins (we intentionally
terminate so the crash handler subprocess can generate a minidump), so
there was no way to gracefully handle panics from third-party code until
now (in rare cases where we need it, like in this case).

To handle this gracefully, we added `crashes::recoverable_panic` which
tells the panic hook to stand down on the current thread so the unwind
can proceed and be caught. This should be used sparingly since caught
panics bypass crash reporting.

Release Notes:

- Fixed a crash when rendering mermaid diagrams in markdown preview.
2026-02-26 15:41:27 +05:30

44 lines
976 B
TOML

[package]
name = "markdown_preview"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "GPL-3.0-or-later"
[lints]
workspace = true
[lib]
path = "src/markdown_preview.rs"
[features]
test-support = []
[dependencies]
anyhow.workspace = true
async-recursion.workspace = true
collections.workspace = true
crashes.workspace = true
editor.workspace = true
fs.workspace = true
gpui.workspace = true
html5ever.workspace = true
language.workspace = true
linkify.workspace = true
log.workspace = true
markup5ever_rcdom.workspace = true
pretty_assertions.workspace = true
pulldown-cmark.workspace = true
settings.workspace = true
theme.workspace = true
ui.workspace = true
urlencoding.workspace = true
util.workspace = true
workspace.workspace = true
zed_actions.workspace = true
mermaid-rs-renderer.workspace = true
[dev-dependencies]
editor = { workspace = true, features = ["test-support"] }
language = { workspace = true, features = ["test-support"] }