Skip to content

Commit

Permalink
fix: fixed telegram link escaping (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno authored Jan 22, 2025
1 parent 40a0fbd commit ea8c43a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/templates/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package templates
import (
"bytes"
"fmt"
"html"
"html/template"
"main/pkg/types"
"main/pkg/utils"
Expand Down Expand Up @@ -77,7 +78,7 @@ func (m *TelegramTemplatesManager) GetTemplate(templateName string) (*template.T

func (m *TelegramTemplatesManager) SerializeLink(link types.Link) template.HTML {
if link.Href != "" {
return template.HTML(fmt.Sprintf("<a href='%s'>%s</a>", link.Href, link.Name))
return template.HTML(fmt.Sprintf("<a href='%s'>%s</a>", link.Href, html.EscapeString(link.Name)))
}

return template.HTML(link.Name)
Expand Down

0 comments on commit ea8c43a

Please sign in to comment.