don't include leading space in hashtag

This commit is contained in:
Ted Unangst 2019-06-15 18:30:59 -04:00
parent 507e4b6c6b
commit fc67125854
1 changed files with 5 additions and 0 deletions

5
fun.go
View File

@ -123,6 +123,11 @@ var re_hashes = regexp.MustCompile(`(?:^|\W)#[[:alnum:]]+`)
func ontologies(s string) []string { func ontologies(s string) []string {
m := re_hashes.FindAllString(s, -1) m := re_hashes.FindAllString(s, -1)
for i, h := range m {
if h[0] != '#' {
m[i] = h[1:]
}
}
return m return m
} }