Check for elements in sections before header

Signed-off-by: Evan Lloyd New-Schmidt <evan@new-schmidt.com>
This commit is contained in:
Evan Lloyd New-Schmidt 2023-11-17 20:11:45 -05:00 committed by Evan Lloyd New-Schmidt
parent cd03fed762
commit 578f8a319d

View file

@ -340,7 +340,8 @@ fn remove_empty_sections(document: &mut Html) {
}
if el
.next_siblings()
.prev_siblings()
.chain(el.next_siblings())
.filter_map(ElementRef::wrap)
.all(|e| is_empty_or_whitespace(&e) || HEADERS.matches(&e))
{