Skip to content

Commit 9769c8f

Browse files
committed
extend tests
1 parent fb805d1 commit 9769c8f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

modules/markup/html_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,15 @@ func TestRender_emoji(t *testing.T) {
287287
test(
288288
":custom-emoji:",
289289
`<p>:custom-emoji:</p>`)
290-
setting.UI.CustomEmojis = append(setting.UI.CustomEmojis, "custom-emoji")
290+
setting.UI.CustomEmojisMap["custom-emoji"] = ":custom-emoji:"
291291
test(
292292
":custom-emoji:",
293293
`<p><span class="emoji" aria-label="custom-emoji"><img alt=":custom-emoji:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/custom-emoji.png"/></span></p>`)
294-
294+
test(
295+
"a :+1: some🐊 \U0001f44d:custom-emoji: :gitea:",
296+
`<p>a <span class="emoji" aria-label="thumbs up">👍</span> some<span class="emoji" aria-label="crocodile">🐊</span> `+
297+
`<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> `+
298+
`<span class="emoji" aria-label="gitea"><img alt=":gitea:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/gitea.png"/></span></p>`)
295299
test(
296300
"Some text with 😄 in the middle",
297301
`<p>Some text with <span class="emoji" aria-label="grinning face with smiling eyes">😄</span> in the middle</p>`)

modules/setting/setting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ var (
259259
Themes: []string{`gitea`, `arc-green`},
260260
Reactions: []string{`+1`, `-1`, `laugh`, `hooray`, `confused`, `heart`, `rocket`, `eyes`},
261261
CustomEmojis: []string{`gitea`, `codeberg`},
262+
CustomEmojisMap: map[string]string{"gitea": ":gitea:", "codeberg": ":codeberg:"},
262263
Notification: struct {
263264
MinTimeout time.Duration
264265
TimeoutStep time.Duration

0 commit comments

Comments
 (0)