all repos — honk @ 162663bf800442ac3bf3946eb3de755f990589ed

my fork of honk

don't let html entities leak as hashtags
Ted Unangst tedu@tedunangst.com
Wed, 03 Jul 2019 16:06:31 -0400
commit

162663bf800442ac3bf3946eb3de755f990589ed

parent

2bd1b418731ad988c3415e39fb1de838051e1468

1 files changed, 9 insertions(+), 3 deletions(-)

jump to
M fun.gofun.go

@@ -122,12 +122,18 @@ var re_hashes = regexp.MustCompile(`(?:^|\W)#[[:alnum:]]+`)

func ontologies(s string) []string { m := re_hashes.FindAllString(s, -1) - for i, h := range m { + j := 0 + for _, h := range m { + if h[0] == '&' { + continue + } if h[0] != '#' { - m[i] = h[1:] + h = h[1:] } + m[j] = h + j++ } - return m + return m[:j] } type Mention struct {