commit 4ac6a107385feb4c355ddd3ea77fd92b78d4bf2d
parent 72f8d618676826b46cf4deba8ab808378595ec01
Author: alex wennerberg <alex@alexwennerberg.com>
Date: Thu, 6 Jan 2022 09:36:38 -0800
bad tag bug fix
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -214,7 +214,7 @@ fn html2text(html: &str) -> String {
}
} else if tag_name_lower.len() > 0
&& tag_name_lower.starts_with("/")
- && is_bad_tag(&tag_name_lower)
+ && is_bad_tag(&tag_name_lower[1..])
{
bad_tag_stack_depth -= 1;
}
@@ -252,7 +252,7 @@ mod tests {
"click <a href=\"http://bit.ly/2n4wXRs\">news</a>",
"click http://bit.ly/2n4wXRs",
),
- // ("<a rel=\"mw:WikiLink\" href=\"/wiki/yet#English\" title=\"yet\">yet</a>, <a rel=\"mw:WikiLink\" href=\"/wiki/not_yet#English\" title=\"not yet\">not yet</a>", "/wiki/yet#English, /wiki/not_yet#English"),
+ ("<a rel=\"mw:WikiLink\" href=\"/wiki/yet#English\" title=\"yet\">yet</a>, <a rel=\"mw:WikiLink\" href=\"/wiki/not_yet#English\" title=\"not yet\">not yet</a>", "/wiki/yet#English, /wiki/not_yet#English"),
// inlines
("strong <strong>text</strong>", "strong text"),