Skip to content

Commit

Permalink
Open links in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Dec 10, 2023
1 parent dc7b1c8 commit ef61ec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slack_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ func parseSlackMrkdwnLinks(message string) string {
// If the link has a label, use it as the anchor text, otherwise use the URL
parts := strings.Split(match[1:len(match)-1], "|")
if len(parts) == 2 {
return fmt.Sprintf(`<a href="%s">%s</a>`, parts[0], parts[1])
return fmt.Sprintf(`<a target="_blank" href="%s">%s</a>`, parts[0], parts[1])
} else {
return fmt.Sprintf(`<a href="%s">%s</a>`, parts[0], parts[0])
return fmt.Sprintf(`<a target="_blank" href="%s">%s</a>`, parts[0], parts[0])
}
})

Expand Down

0 comments on commit ef61ec9

Please sign in to comment.