(buf: &str)
| 383 | } |
| 384 | |
| 385 | pub fn dehtml_manually(buf: &str) -> String { |
| 386 | // Just strip out everything between "<" and ">" |
| 387 | let mut strbuilder = String::new(); |
| 388 | let mut show_next_chars = true; |
| 389 | for c in buf.chars() { |
| 390 | match c { |
| 391 | '<' => show_next_chars = false, |
| 392 | '>' => show_next_chars = true, |
| 393 | _ => { |
| 394 | if show_next_chars { |
| 395 | strbuilder.push(c) |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | strbuilder |
| 401 | } |
| 402 | |
| 403 | #[cfg(test)] |
| 404 | mod tests { |