aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2020-07-25 09:40:04 -0400
committerGitHub <noreply@github.com>2020-07-25 16:40:04 +0300
commitea1ed802a308698f6b30dd695d0b97251d552775 (patch)
treefca2988d50e47cb37a7fc48771174e277d19d3bb /modules/markup
parent8baf5ca22814878334844c435bf8dd59349f5a69 (diff)
downloadgitea-ea1ed802a308698f6b30dd695d0b97251d552775.tar.gz
gitea-ea1ed802a308698f6b30dd695d0b97251d552775.zip
Fix emoji detection in certain cases (#12320)
* Fix emoji detection certain cases Previous tests weren't complicated enough so there were some situations where emojis were't detected properly. Find the earliest occurance in addition to checking for the longest combination. Fixes #12312 * ok spell bot Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/markup')
-rw-r--r--modules/markup/html_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index a73236a7a3..69c4e675f5 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -266,6 +266,10 @@ func TestRender_emoji(t *testing.T) {
test(
"Some text with 😄😄 2 emoji next to each other",
`<p>Some text with <span class="emoji" aria-label="grinning face with smiling eyes">😄</span><span class="emoji" aria-label="grinning face with smiling eyes">😄</span> 2 emoji next to each other</p>`)
+ test(
+ "😎ðŸĪŠðŸ”ðŸĪ‘❓",
+ `<p><span class="emoji" aria-label="smiling face with sunglasses">😎</span><span class="emoji" aria-label="zany face">ðŸĪŠ</span><span class="emoji" aria-label="locked with key">🔐</span><span class="emoji" aria-label="money-mouth face">ðŸĪ‘</span><span class="emoji" aria-label="question mark">❓</span></p>`)
+
// should match nothing
test(
"2001:0db8:85a3:0000:0000:8a2e:0370:7334",