all repos — honk @ 5250aaddd39473a422fa1fa32047003298973b03

my fork of honk

i tried parsing regex and now i have three problems.
just fix the hashtag case instead of thinking.
Ted Unangst tedu@tedunangst.com
Sun, 17 Jan 2021 19:05:57 -0500
commit

5250aaddd39473a422fa1fa32047003298973b03

parent

2326db38dbee7da1bf861752eca2f297aeb62115

2 files changed, 5 insertions(+), 6 deletions(-)

jump to
M docs/changelog.txtdocs/changelog.txt

@@ -4,7 +4,7 @@ === next

+ Fix mastodon import. -+ Better regex for filters. ++ Filters work better with hashtags. + Fix hoot to work with Twitter's latest crap.
M hfcs.gohfcs.go

@@ -21,7 +21,6 @@ "net/http"

"regexp" "sort" "time" - "unicode" "humungus.tedunangst.com/r/webs/cache" )

@@ -110,8 +109,8 @@ expflush = filt.Expiration

} } if t := filt.Text; t != "" { - wordfront := unicode.IsLetter(rune(t[0])) - wordtail := unicode.IsLetter(rune(t[len(t)-1])) + wordfront := t[0] != '#' + wordtail := true t = "(?i:" + t + ")" if wordfront { t = "\\b" + t

@@ -126,8 +125,8 @@ continue

} } if t := filt.Rewrite; t != "" { - wordfront := unicode.IsLetter(rune(t[0])) - wordtail := unicode.IsLetter(rune(t[len(t)-1])) + wordfront := t[0] != '#' + wordtail := true t = "(?i:" + t + ")" if wordfront { t = "\\b" + t