summaryrefslogtreecommitdiffstats
path: root/modules/markup/html_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-06-29 16:28:38 +0200
committerGitHub <noreply@github.com>2021-06-29 16:28:38 +0200
commit65548359cc5c78455b638c5be6fdec3e321e717a (patch)
tree0236a4aaa8e0c2a781e0383a39a667cf03528a1e /modules/markup/html_test.go
parentaac663e0da0af644ae1011d268d027160265dce3 (diff)
downloadgitea-65548359cc5c78455b638c5be6fdec3e321e717a.tar.gz
gitea-65548359cc5c78455b638c5be6fdec3e321e717a.zip
Add custom emoji support (#16004)
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r--modules/markup/html_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index 8c3d2b5395..85418892ef 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -284,7 +284,18 @@ func TestRender_emoji(t *testing.T) {
test(
":gitea:",
`<p><span class="emoji" aria-label="gitea"><img alt=":gitea:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/gitea.png"/></span></p>`)
-
+ test(
+ ":custom-emoji:",
+ `<p>:custom-emoji:</p>`)
+ setting.UI.CustomEmojisMap["custom-emoji"] = ":custom-emoji:"
+ test(
+ ":custom-emoji:",
+ `<p><span class="emoji" aria-label="custom-emoji"><img alt=":custom-emoji:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/custom-emoji.png"/></span></p>`)
+ test(
+ "θΏ™ζ˜―ε­—η¬¦:1::+1: some🐊 \U0001f44d:custom-emoji: :gitea:",
+ `<p>θΏ™ζ˜―ε­—η¬¦:1:<span class="emoji" aria-label="thumbs up">πŸ‘</span> some<span class="emoji" aria-label="crocodile">🐊</span> `+
+ `<span class="emoji" aria-label="thumbs up">πŸ‘</span><span class="emoji" aria-label="custom-emoji"><img alt=":custom-emoji:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/custom-emoji.png"/></span> `+
+ `<span class="emoji" aria-label="gitea"><img alt=":gitea:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/gitea.png"/></span></p>`)
test(
"Some text with πŸ˜„ in the middle",
`<p>Some text with <span class="emoji" aria-label="grinning face with smiling eyes">πŸ˜„</span> in the middle</p>`)