(raw: &str)
| 1337 | } |
| 1338 | |
| 1339 | fn normalize_html_text(raw: &str) -> String { |
| 1340 | let without_tags = if let Ok(re) = Regex::new(r"<[^>]+>") { |
| 1341 | re.replace_all(raw, " ").into_owned() |
| 1342 | } else { |
| 1343 | raw.to_string() |
| 1344 | }; |
| 1345 | |
| 1346 | without_tags |
| 1347 | .replace(""", "\"") |
| 1348 | .replace("'", "'") |
| 1349 | .replace("&", "&") |
| 1350 | .replace("<", "<") |
| 1351 | .replace(">", ">") |
| 1352 | .split_whitespace() |
| 1353 | .collect::<Vec<_>>() |
| 1354 | .join(" ") |
| 1355 | .trim() |
| 1356 | .to_string() |
| 1357 | } |
| 1358 | |
| 1359 | fn is_meaningful_meta_description(text: &str) -> bool { |
| 1360 | let lower = text.to_lowercase(); |
no test coverage detected