From 61398f61534be0a37300f480cb50ea88d36297b8 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Mon, 28 Mar 2022 23:17:40 +0100 Subject: [PATCH] Don't store images whilst raking, for now Fixes #5 --- quickpeep_densedoc/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quickpeep_densedoc/src/lib.rs b/quickpeep_densedoc/src/lib.rs index 9c0274f..e4af533 100644 --- a/quickpeep_densedoc/src/lib.rs +++ b/quickpeep_densedoc/src/lib.rs @@ -313,7 +313,12 @@ impl DenseTreeBuilder { let alt = simplify_whitespace(attrs.get("alt").unwrap_or("").trim()); - self.nodes.push(DenseTree::Image { src, alt }); + // Don't actually emit an image: it's not worth the space. + // self.nodes.push(DenseTree::Image { src, alt }); + + if !alt.is_empty() { + self.nodes.push(DenseTree::Text(alt)); + } } "p" | "pre" => { // Paragraphs must have 2 preceding newlines.