1
0
Fork 0
forked from alemi/upub

fix(mdhtml): don't add rel and target in mentions

This commit is contained in:
əlemi 2024-07-04 02:12:52 +02:00
parent 9f81116ba3
commit b53bd5527f
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -51,12 +51,15 @@ impl TokenSink for Sink {
} }
}, },
"a" => { "a" => {
let any_attr = !tag.attrs.is_empty(); let mut any_attr = !tag.attrs.is_empty();
for attr in tag.attrs { for attr in tag.attrs {
match attr.name.local.as_ref() { match attr.name.local.as_ref() {
"href" => self.buffer.push_str(&format!(" href=\"{}\"", attr.value.as_ref())), "href" => self.buffer.push_str(&format!(" href=\"{}\"", attr.value.as_ref())),
"title" => self.buffer.push_str(&format!(" title=\"{}\"", attr.value.as_ref())), "title" => self.buffer.push_str(&format!(" title=\"{}\"", attr.value.as_ref())),
"class" => if attr.value.as_ref() == "u-url mention" { self.buffer.push_str(" class=\"u-url mention\"") }, "class" => if attr.value.as_ref() == "u-url mention" {
any_attr = false;
self.buffer.push_str(" class=\"u-url mention\"")
},
_ => {}, _ => {},
} }
} }