From 4c1ff57f1a41197bb6f6797d33461c76378e354c Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Fri, 29 May 2020 12:08:36 -0400 Subject: Update emoji regex (#11584) When matching emoji, use a regex built from the data we have instead of something generic using unicode ranges. A generic regex can't tell the difference between two separate emoji next to each other or one emoji that is built out of two separate emoji next to each other. This means that emoji that are next to each other without space in between will be now accurately spanned individually with proper title etc... --- modules/markup/html_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/markup/html_test.go') diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 65d2d327d6..686057d11f 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -263,7 +263,9 @@ func TestRender_emoji(t *testing.T) { test( "Some text with :smile: in the middle", `

Some text with 😄 in the middle

`) - + test( + "Some text with 😄😄 2 emoji next to each other", + `

Some text with 😄😄 2 emoji next to each other

`) // should match nothing test( "2001:0db8:85a3:0000:0000:8a2e:0370:7334", -- cgit v1.2.3