Skip to content

Commit

Permalink
ST1018: don't flag emojis containing U+FE0F,U+200D
Browse files Browse the repository at this point in the history
Previous check didn't exclude this case.
  • Loading branch information
1sixth committed Oct 19, 2023
1 parent 8ad93fe commit 95aba9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stylecheck/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ func CheckInvisibleCharacters(pass *analysis.Pass) (interface{}, error) {
if unicode.Is(unicode.Cf, r) {
// Don't flag joined emojis. These are multiple emojis joined with ZWJ, which some platform render as single composite emojis.
// For the purpose of this check, we consider all symbols, including all symbol modifiers, emoji.
if r != zwj || (r == zwj && !unicode.Is(unicode.S, prev)) {
if r != zwj || (prev != '\ufe0f' && !unicode.Is(unicode.S, prev)) {
invalids = append(invalids, invalid{r, off})
hasFormat = true
}
Expand Down

0 comments on commit 95aba9c

Please sign in to comment.