diff options
author | 6543 <6543@obermui.de> | 2021-06-29 16:28:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 16:28:38 +0200 |
commit | 65548359cc5c78455b638c5be6fdec3e321e717a (patch) | |
tree | 0236a4aaa8e0c2a781e0383a39a667cf03528a1e /modules/markup/html_test.go | |
parent | aac663e0da0af644ae1011d268d027160265dce3 (diff) | |
download | gitea-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.go | 13 |
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>`) |