better herding of emus
This commit is contained in:
parent
6bd837c378
commit
02da8c739a
|
@ -575,6 +575,9 @@ func jonkjonk(user *WhatAbout, h *Honk) (map[string]interface{}, map[string]inte
|
||||||
}
|
}
|
||||||
var atts []interface{}
|
var atts []interface{}
|
||||||
for _, d := range h.Donks {
|
for _, d := range h.Donks {
|
||||||
|
if re_emus.MatchString(d.Name) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
jd := NewJunk()
|
jd := NewJunk()
|
||||||
jd["mediaType"] = d.Media
|
jd["mediaType"] = d.Media
|
||||||
jd["name"] = d.Name
|
jd["name"] = d.Name
|
||||||
|
|
5
honk.go
5
honk.go
|
@ -170,7 +170,9 @@ func reverbolate(honks []*Honk) {
|
||||||
h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier))
|
h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier))
|
||||||
for i := 0; i < len(h.Donks); i++ {
|
for i := 0; i < len(h.Donks); i++ {
|
||||||
if zap[h.Donks[i]] {
|
if zap[h.Donks[i]] {
|
||||||
h.Donks = append(h.Donks[0:i], h.Donks[i+1:]...)
|
copy(h.Donks[i:], h.Donks[i+1:])
|
||||||
|
h.Donks = h.Donks[:len(h.Donks)-1]
|
||||||
|
i--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -824,6 +826,7 @@ var re_emus = regexp.MustCompile(`:[[:alnum:]_]+:`)
|
||||||
|
|
||||||
func herdofemus(noise string) []Emu {
|
func herdofemus(noise string) []Emu {
|
||||||
m := re_emus.FindAllString(noise, -1)
|
m := re_emus.FindAllString(noise, -1)
|
||||||
|
m = oneofakind(m)
|
||||||
var emus []Emu
|
var emus []Emu
|
||||||
for _, e := range m {
|
for _, e := range m {
|
||||||
fname := e[1 : len(e)-1]
|
fname := e[1 : len(e)-1]
|
||||||
|
|
Loading…
Reference in New Issue