Skip to content

Commit c569e94

Browse files
committed
Use the default tag_attribute's as well
1 parent 9073d1a commit c569e94

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/render.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ impl<'a> MarkdownRenderer<'a> {
2323
/// relative links in the input document. See that function for more detail.
2424
fn new(base_url: Option<&'a str>) -> MarkdownRenderer<'a> {
2525
let tag_attributes = hashmap(&[
26-
("a", hashset(&["href", "id", "target"])),
27-
("img", hashset(&["width", "height", "src", "alt", "align"])),
26+
("a", hashset(&["id", "target"])),
2827
("input", hashset(&["checked", "disabled", "type"])),
29-
("th", hashset(&["rowspan", "colspan"])),
30-
("td", hashset(&["rowspan", "colspan"])),
3128
]);
3229
let allowed_classes = hashmap(&[(
3330
"code",
@@ -54,7 +51,8 @@ impl<'a> MarkdownRenderer<'a> {
5451
html_sanitizer
5552
.add_tags(&["input"])
5653
.link_rel(Some("nofollow noopener noreferrer"))
57-
.tag_attributes(tag_attributes)
54+
.add_tag_attributes("a", &["id", "target"])
55+
.add_tag_attributes("input", &["checked", "disabled", "type"])
5856
.allowed_classes(allowed_classes)
5957
.url_relative(sanitize_url)
6058
.id_prefix(Some("user-content-"));

0 commit comments

Comments
 (0)