all repos — honk @ 821ce27c9785bd2baa1a647378238d55d5a0e612

my fork of honk

check emus really exist before embedding
Ted Unangst tedu@tedunangst.com
Sat, 30 Dec 2023 16:56:49 -0500
commit

821ce27c9785bd2baa1a647378238d55d5a0e612

parent

1eb3f5b2dc7f16cecd88dd303276ffbe1aa3bddc

1 files changed, 6 insertions(+), 6 deletions(-)

jump to
M fun.gofun.go

@@ -162,8 +162,8 @@ }

} } if local && h.What != "bonked" { - emu, ok := emucache.Get(e) - if ok { + emu, _ := emucache.Get(e) + if emu.ID != "" { return fmt.Sprintf(`<img class="emu" title="%s" src="%s">`, emu.Name, emu.ID) } }

@@ -264,8 +264,8 @@ }

} } if local { - emu, ok := emucache.Get(e) - if ok { + emu, _ := emucache.Get(e) + if emu.ID != "" { return fmt.Sprintf(`<img class="emu" title="%s" src="%s">`, emu.Name, emu.ID) } }

@@ -444,8 +444,8 @@ m := re_emus.FindAllString(noise, -1)

m = oneofakind(m) var emus []Emu for _, e := range m { - emu, ok := emucache.Get(e) - if !ok { + emu, _ := emucache.Get(e) + if emu.ID == "" { continue } emus = append(emus, emu)