better herding of emus
Ted Unangst tedu@tedunangst.com
Sat, 13 Apr 2019 12:32:24 -0400
2 files changed,
7 insertions(+),
1 deletions(-)
M
activity.go
→
activity.go
@@ -575,6 +575,9 @@ jo["tag"] = tags
} var atts []interface{} for _, d := range h.Donks { + if re_emus.MatchString(d.Name) { + continue + } jd := NewJunk() jd["mediaType"] = d.Media jd["name"] = d.Name
M
honk.go
→
honk.go
@@ -170,7 +170,9 @@ }
h.HTML = template.HTML(re_emus.ReplaceAllStringFunc(string(h.HTML), emuxifier)) for i := 0; i < len(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 { m := re_emus.FindAllString(noise, -1) + m = oneofakind(m) var emus []Emu for _, e := range m { fname := e[1 : len(e)-1]