| 1 |
use super::*; |
| 2 |
|
| 3 |
#[test] |
| 4 |
fn no_empty_link() { |
| 5 |
html_opts!( |
| 6 |
[render.ignore_empty_links], |
| 7 |
"[](https://example.com/evil-link-for-seo-spam)", |
| 8 |
"<p>[](https://example.com/evil-link-for-seo-spam)</p>\n", |
| 9 |
); |
| 10 |
|
| 11 |
html_opts!( |
| 12 |
[render.ignore_empty_links], |
| 13 |
"[ ](https://example.com/evil-link-for-seo-spam)", |
| 14 |
"<p>[ ](https://example.com/evil-link-for-seo-spam)</p>\n", |
| 15 |
); |
| 16 |
} |
| 17 |
|
| 18 |
#[test] |
| 19 |
fn empty_image_allowed() { |
| 20 |
html_opts!( |
| 21 |
[render.ignore_empty_links], |
| 22 |
"", |
| 23 |
"<p><img src=\"https://example.com/evil-link-for-seo-spam\" alt=\" \" /></p>\n", |
| 24 |
); |
| 25 |
} |
| 26 |
|
| 27 |
#[test] |
| 28 |
fn image_inside_link_allowed() { |
| 29 |
html_opts!( |
| 30 |
[render.ignore_empty_links], |
| 31 |
"[](https://example.com/)", |
| 32 |
"<p><a href=\"https://example.com/\"><img src=\"https://example.com/image.png\" alt=\"\" /></a></p>\n", |
| 33 |
); |
| 34 |
} |