From 0458604abcda0eb85bac60f2197869c689805e3b Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 20 Jun 2018 18:48:48 +0500 Subject: [PATCH] :recycle: Use NewLink util in NewMention utils --- utils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.go b/utils.go index 79985d2..92a59a3 100644 --- a/utils.go +++ b/utils.go @@ -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(``, text, ``) + link := NewInlineMentionURL(id) + return NewHtmlURL(text, link) } func NewHtmlCode(text string) string {