1
0
Fork 0
forked from alemi/upub

fix(mdhtml): dont add stuff on closing tags

This commit is contained in:
əlemi 2024-05-29 05:04:59 +02:00
parent b097e4a725
commit b4bd7c845f
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -29,6 +29,9 @@ impl TokenSink for Sink {
self.0.push_str(tag.name.as_ref()); self.0.push_str(tag.name.as_ref());
if tag.self_closing {
self.0.push('/');
} else {
match tag.name.as_ref() { match tag.name.as_ref() {
"img" => for attr in tag.attrs { "img" => for attr in tag.attrs {
match attr.name.local.as_ref() { match attr.name.local.as_ref() {
@ -50,10 +53,8 @@ impl TokenSink for Sink {
}, },
_ => {}, _ => {},
} }
if tag.self_closing {
self.0.push('/');
} }
self.0.push('>'); self.0.push('>');
}, },
Token::CharacterTokens(txt) => self.0.push_str(txt.as_ref()), Token::CharacterTokens(txt) => self.0.push_str(txt.as_ref()),