From c4028e52fad2a5e96d854179a01aefffd6496bf5 Mon Sep 17 00:00:00 2001 From: Evan Lloyd New-Schmidt Date: Thu, 10 Aug 2023 16:59:43 -0400 Subject: [PATCH] Preserve excerpts Signed-off-by: Evan Lloyd New-Schmidt --- src/html.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/html.rs b/src/html.rs index fa85ce5..2684c49 100644 --- a/src/html.rs +++ b/src/html.rs @@ -33,6 +33,10 @@ static ELEMENT_ALLOW_LIST: Lazy = Lazy::new(|| { // Meta tags that affect rendering. "head > meta[charset]", "head > meta[http-equiv]", + // Content from other articles (expanded later) + // TODO: See if these are used in other ways. + "div.excerpt-block", + "div.excerpt", ] .join(", "), ) @@ -263,7 +267,7 @@ fn final_expansions(document: &mut Html) { .filter_map(ElementRef::wrap) { if (el.value().name() == "span" && el.value().attrs().next().is_none()) - || ["section", "body", "html"].contains(&el.value().name()) + || ["section", "div", "body", "html"].contains(&el.value().name()) { to_expand.push(el.id()); }