From eb08529f35ce33ed98c34fb48013f0f4a5fc9635 Mon Sep 17 00:00:00 2001 From: Autumn! <86073772+autumnull@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:20:22 +0000 Subject: [chore/bugfix] Switch markdown from blackfriday to goldmark (#1267) Co-authored-by: Autumn! --- internal/util/statustools.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/util/statustools.go') diff --git a/internal/util/statustools.go b/internal/util/statustools.go index b1fd7968b..7479fbff5 100644 --- a/internal/util/statustools.go +++ b/internal/util/statustools.go @@ -78,14 +78,14 @@ func FindHashtagSpansInText(text string) []Span { inTag := false for i, r := range text { - if r == '#' && isHashtagBoundary(prev) { + if r == '#' && IsHashtagBoundary(prev) { // Start of hashtag. inTag = true start = i - } else if inTag && !isPermittedInHashtag(r) && !isHashtagBoundary(r) { + } else if inTag && !IsPermittedInHashtag(r) && !IsHashtagBoundary(r) { // Inside the hashtag, but it was a phoney, gottem. inTag = false - } else if inTag && isHashtagBoundary(r) { + } else if inTag && IsHashtagBoundary(r) { // End of hashtag. inTag = false appendTag(&tags, text, start, i) @@ -119,12 +119,12 @@ func DeriveEmojisFromText(text string) []string { return UniqueStrings(emojis) } -func isPermittedInHashtag(r rune) bool { +func IsPermittedInHashtag(r rune) bool { return unicode.IsLetter(r) || unicode.IsNumber(r) } // Decides where to break before or after a hashtag. -func isHashtagBoundary(r rune) bool { +func IsHashtagBoundary(r rune) bool { return r == '#' || // `###lol` should work unicode.IsSpace(r) || // All kinds of Unicode whitespace. unicode.IsControl(r) || // All kinds of control characters, like tab. -- cgit v1.2.3