-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept hyphen and plus sign in emoji detection
Fixes #5635
- Loading branch information
1 parent
526b5b1
commit 3038464
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -223,7 +223,7 @@ func lexEmoji(l *pageLexer) stateFunc { | ||
break | break | ||
} | } | ||
r, _ := utf8.DecodeRune(l.input[i:]) | r, _ := utf8.DecodeRune(l.input[i:]) | ||
if !isAlphaNumeric(r) { | if !(isAlphaNumericOrHyphen(r) || r == '+') { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
anthonyfok
Author
Member
|
|||
break | break | ||
} | } | ||
} | } | ||
|
So, one reason why this broke in the first place was a missing test. This fix just waits for it to be broken again. I suggest you expand on the test in hugolib and create some content from the entire emoj map and verify that the result "looks like only emojs" (i.e. have no ":" in it).