From b53bd5527f2d42f7497e44504f7c50bfde4af3d5 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 4 Jul 2024 02:12:52 +0200 Subject: [PATCH] fix(mdhtml): don't add rel and target in mentions --- utils/mdhtml/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/mdhtml/lib.rs b/utils/mdhtml/lib.rs index 1439ebd..4eef71b 100644 --- a/utils/mdhtml/lib.rs +++ b/utils/mdhtml/lib.rs @@ -51,12 +51,15 @@ impl TokenSink for Sink { } }, "a" => { - let any_attr = !tag.attrs.is_empty(); + let mut any_attr = !tag.attrs.is_empty(); for attr in tag.attrs { match attr.name.local.as_ref() { "href" => self.buffer.push_str(&format!(" href=\"{}\"", 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\"") + }, _ => {}, } }