all repos — honk @ cb740b391cef594556ca3aa86caeb2ab206d0cfb

my fork of honk

less aggressive rewrite filter rewriting
Ted Unangst tedu@tedunangst.com
Sat, 17 Jun 2023 20:26:38 -0400
commit

cb740b391cef594556ca3aa86caeb2ab206d0cfb

parent

647b530e0bb47a6198cc1b7df9d02f4590072724

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M hfcs.gohfcs.go

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

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

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

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

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

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