1
0

♻️ Use NewLink util in NewMention utils

This commit is contained in:
Maxim Lebedev 2018-06-20 18:48:48 +05:00
parent d4afafdf81
commit 0458604abc
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F

View File

@ -38,7 +38,8 @@ func NewMarkdownURL(text string, link *url.URL) string {
}
func NewMarkdownMention(text string, id int) string {
return fmt.Sprint("[", text, "](tg://user?id=", id, ")")
link := NewInlineMentionURL(id)
return NewMarkdownURL(text, link)
}
func NewMarkdownCode(text string) string {
@ -62,7 +63,8 @@ func NewHtmlURL(text string, link *url.URL) string {
}
func NewHtmlMention(text string, id int) string {
return fmt.Sprint(`<a href="tg://user?id=`, id, `">`, text, `</a>`)
link := NewInlineMentionURL(id)
return NewHtmlURL(text, link)
}
func NewHtmlCode(text string) string {