diff --git a/exporter/svg/src/backend/mod.rs b/exporter/svg/src/backend/mod.rs index 1b2cd4dc..adecf9b9 100644 --- a/exporter/svg/src/backend/mod.rs +++ b/exporter/svg/src/backend/mod.rs @@ -557,6 +557,13 @@ fn render_path(path: &ir::PathItem) -> SvgText { /// Render a [`ir::ImageItem`] into svg text. #[comemo::memoize] fn render_image_item(img: &ir::ImageItem) -> SvgText { + match &img.image.alt { + Some(t) if t.as_ref() == "!typst-inlined-svg" => { + return SvgText::Plain(String::from_utf8(img.image.data.clone()).unwrap()) + } + _ => {} + } + SvgText::Plain(render_image(&img.image, img.size, true, "")) } diff --git a/fuzzers/corpora/visualize/video_00.typ b/fuzzers/corpora/visualize/video_00.typ new file mode 100644 index 00000000..9325d6a7 --- /dev/null +++ b/fuzzers/corpora/visualize/video_00.typ @@ -0,0 +1,16 @@ + +#image.decode(``` + + + +```.text, alt: "!typst-inlined-svg")