bug fix: set LinkType to Email for email autolinks

This commit is contained in:
Noah Hellman 2023-03-19 13:30:51 +01:00
parent e458955d00
commit 62e73100a6

View file

@ -746,12 +746,12 @@ impl<'s> Parser<'s> {
}
inline::Container::Autolink => {
let url = self.inlines.src(inline.span);
let url = if url.contains('@') {
format!("mailto:{}", url).into()
let (url, ty) = if url.contains('@') {
(format!("mailto:{}", url).into(), LinkType::Email)
} else {
url
(url, LinkType::AutoLink)
};
Container::Link(url, LinkType::AutoLink)
Container::Link(url, ty)
}
};
if matches!(inline.kind, inline::EventKind::Enter(_)) {