mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add hashtag colouring to Twitter widget
This commit is contained in:
parent
2af837d5cf
commit
c738fa9eac
@ -80,6 +80,10 @@ func (widget *Widget) highlightText(text string) string {
|
||||
linkRegExp := regexp.MustCompile(`http[s:\/.0-9A-Za-z]*`)
|
||||
result = linkRegExp.ReplaceAllString(result, "[lightblue::u]${0}[white::-]")
|
||||
|
||||
// Hash tags
|
||||
hashRegExp := regexp.MustCompile(`#[0-9A-Za-z_]*`)
|
||||
result = hashRegExp.ReplaceAllString(result, "[yellow]${0}[white]")
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user