lib: don't prepend mailto to url in autolink Event
better to provide the original url, the event is already tagged as email also avoids a string allocation
This commit is contained in:
parent
62e73100a6
commit
05a4992d99
2 changed files with 8 additions and 4 deletions
|
@ -746,10 +746,10 @@ impl<'s> Parser<'s> {
|
|||
}
|
||||
inline::Container::Autolink => {
|
||||
let url = self.inlines.src(inline.span);
|
||||
let (url, ty) = if url.contains('@') {
|
||||
(format!("mailto:{}", url).into(), LinkType::Email)
|
||||
let ty = if url.contains('@') {
|
||||
LinkType::Email
|
||||
} else {
|
||||
(url, LinkType::AutoLink)
|
||||
LinkType::AutoLink
|
||||
};
|
||||
Container::Link(url, ty)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue