Fix formatLinks() not working

This broke when moving to the standard library for escaping and
unescaping HTML.  The original escaping code replaced "//" with
"&x2F;&x2F;" while the standard library doesn't.
This commit is contained in:
Zorchenhimer 2019-03-11 15:41:41 -04:00
parent 86ba07b4f7
commit b62b89c13e
1 changed files with 1 additions and 2 deletions

View File

@ -88,8 +88,7 @@ func (cl *Client) NewMsg(msg string) {
func formatLinks(input string) string {
newMsg := []string{}
for _, word := range strings.Split(input, " ") {
if strings.HasPrefix(word, "http://") || strings.HasPrefix(word, "https://") {
//word = unescape(word)
if strings.HasPrefix(word, "http://") || strings.HasPrefix(word, "https://") {
word = html.UnescapeString(word)
word = fmt.Sprintf(`<a href="%s" target="_blank">%s</a>`, word, word)
}