Skip to content

Commit 3ade9d4

Browse files
notriddlecarols10cents
authored andcommitted
Add rel="noopener noreferrer" to the links in READMEs
1 parent 977415e commit 3ade9d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<'a> MarkdownRenderer<'a> {
6969
.cloned()
7070
.collect();
7171
let html_sanitizer = Ammonia {
72-
link_rel: Some("nofollow"),
72+
link_rel: Some("nofollow noopener noreferrer"),
7373
keep_cleaned_elements: true,
7474
tags: tags,
7575
tag_attributes: tag_attributes,
@@ -161,7 +161,7 @@ mod tests {
161161
let result = markdown_to_html(text).unwrap();
162162
assert_eq!(
163163
result,
164-
"<p>foo_readme\\n\\n<a href=\"https://crates.io/crates/cargo-registry\" rel=\"nofollow\">Crate page</a></p>\n"
164+
"<p>foo_readme\\n\\n<a href=\"https://crates.io/crates/cargo-registry\" rel=\"nofollow noopener noreferrer\">Crate page</a></p>\n"
165165
);
166166
}
167167
}

0 commit comments

Comments
 (0)