Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/decoders/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ pub fn html_to_text(input: &str) -> String {
match input.get(token_start..token_end + 1) {
Some(tag)
if tag.eq_ignore_ascii_case(b"br")
|| (tag.eq_ignore_ascii_case(b"p") && is_tag_close) =>
|| (tag.eq_ignore_ascii_case(b"p") && is_tag_close)
|| (tag.eq_ignore_ascii_case(b"div") && is_tag_close) =>
{
result.push('\n');
is_after_space = false;
Expand Down Expand Up @@ -2390,6 +2391,13 @@ mod tests {
" <p>please unsubscribe <a href=#>here</a>.</p> ",
"please unsubscribe here.\n",
),
(
concat!(
"<div>what is the</div>weather <div>",
"today</div>"
),
"what is the\nweather today\n",
),
];

for input in inputs {
Expand Down