Use the default tag_attribute's as well
@@ -23,11 +23,8 @@ impl<'a> MarkdownRenderer<'a> {
/// relative links in the input document. See that function for more detail.
fn new(base_url: Option<&'a str>) -> MarkdownRenderer<'a> {
let tag_attributes = hashmap(&[
- ("a", hashset(&["href", "id", "target"])),
- ("img", hashset(&["width", "height", "src", "alt", "align"])),
+ ("a", hashset(&["id", "target"])),
("input", hashset(&["checked", "disabled", "type"])),
- ("th", hashset(&["rowspan", "colspan"])),
- ("td", hashset(&["rowspan", "colspan"])),
]);
let allowed_classes = hashmap(&[(
"code",
@@ -54,7 +51,8 @@ impl<'a> MarkdownRenderer<'a> {
html_sanitizer
.add_tags(&["input"])
.link_rel(Some("nofollow noopener noreferrer"))
- .tag_attributes(tag_attributes)
+ .add_tag_attributes("a", &["id", "target"])
+ .add_tag_attributes("input", &["checked", "disabled", "type"])
.allowed_classes(allowed_classes)
.url_relative(sanitize_url)
.id_prefix(Some("user-content-"));
