[backend/libmfm] When converting from HTML, shorten http & -s links with identical text and link components
This commit is contained in:
parent
7cee8513de
commit
c3c85419e4
1 changed files with 3 additions and 0 deletions
|
@ -34,6 +34,9 @@ internal class HtmlParser(IEnumerable<Note.MentionedUser> mentions)
|
|||
: $"<plain>{el.TextContent}</plain>";
|
||||
}
|
||||
|
||||
if (el.TextContent == href && (href.StartsWith("http://") || href.StartsWith("https://")))
|
||||
return href;
|
||||
|
||||
return $"[{el.TextContent}]({href})";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue