From 113b87c8c8d5a51c113b92aa2d8ea1a28080cec9 Mon Sep 17 00:00:00 2001 From: Andromeda Date: Wed, 15 Apr 2026 09:22:00 +0000 Subject: [PATCH] count div as newline --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f4490d4..06fb1ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -132,7 +132,7 @@ fn handle_tag(s: &str) -> (String, usize) { (link, total_skip) } // Line breaks and list items - "br" | "br/" | "li" | "/ol" | "/ul" => ("\r\n".to_string(), tag_content.len() + 1), + "div" | "br" | "br/" | "li" | "/ol" | "/ul" => ("\r\n".to_string(), tag_content.len() + 1), // Paragraphs and headings "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "/h1" | "/h2" | "/h3" | "/h4" | "/h5" | "/h6" => ("\r\n\r\n".to_string(), tag_content.len() + 1), @@ -230,7 +230,7 @@ mod tests { link_ignore_attributes_2: "yet, not yet" to "yet (/wiki/yet#English), not yet (/wiki/not_yet#English)", // Inline elements ignore_inline: "strong text" to "strong text", - ignore_inline_attributes: "some
div
" to "some div", + ignore_inline_attributes: "some
div
" to "some \r\ndiv", // Line breaks and spaces collapse_spaces: "should ignore more spaces" to "should ignore more spaces", collapse_linebreaks: "a\nb\nc" to "a b c",