summaryrefslogtreecommitdiffstats
path: root/modules/markup/html_test.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2020-05-29 17:12:53 -0400
committerGitHub <noreply@github.com>2020-05-29 22:12:53 +0100
commit0e44fab5d69787565d831dd674eb4961068d67b1 (patch)
tree940b550a1d99e567ab69771513ef10e59c5f4263 /modules/markup/html_test.go
parent6ad0d0a1b9990cbefe46a1db37095c33617acea2 (diff)
downloadgitea-0e44fab5d69787565d831dd674eb4961068d67b1.tar.gz
gitea-0e44fab5d69787565d831dd674eb4961068d67b1.zip
Update emoji regex (#11584) (#11679)
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...
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r--modules/markup/html_test.go4
1 files changed, 3 insertions, 1 deletions
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",
`<p>Some text with <span class="emoji" aria-label="grinning face with smiling eyes">😄</span> in the middle</p>`)
-
+ 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>`)
// should match nothing
test(
"2001:0db8:85a3:0000:0000:8a2e:0370:7334",