()
| 468 | |
| 469 | #[test] |
| 470 | fn test_dehtml_parse_p() { |
| 471 | let html = "<p>Foo</p><p>Bar</p>"; |
| 472 | let plain = dehtml(html).unwrap().text; |
| 473 | assert_eq!(plain, "Foo\n\nBar"); |
| 474 | |
| 475 | let html = "<p>Foo<p>Bar"; |
| 476 | let plain = dehtml(html).unwrap().text; |
| 477 | assert_eq!(plain, "Foo\n\nBar"); |
| 478 | |
| 479 | let html = "<p>Foo</p><p>Bar<p>Baz"; |
| 480 | let plain = dehtml(html).unwrap().text; |
| 481 | assert_eq!(plain, "Foo\n\nBar\n\nBaz"); |
| 482 | } |
| 483 | |
| 484 | #[test] |
| 485 | fn test_dehtml_parse_href() { |