From 4c47c95d8823ae04197f5c3d036180cee9a962d5 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 19 Apr 2020 09:17:42 -0700 Subject: header descendants --- src/main.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1edece5..fabdafe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,13 +130,7 @@ impl Bk { let mut chapter = Vec::new(); for n in doc.descendants() { match n.tag_name().name() { - "h1" | "h2" | "h3" | "h4" | "h5" | "h6" => { - let text = n.descendants().find(|n| n.is_text()).unwrap(); - chapter.push(format!("# {}", text.text().unwrap())); - chapter.push(String::from("")); - } - //"div" => chapter.push(String::from("")), - "p" => { + "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" => { chapter.push(n.descendants() .filter(|n| n.is_text()) .map(|n| n.text().unwrap()) -- cgit v1.2.3