aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup/markdown
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-12-16 00:49:12 +0100
committerGitHub <noreply@github.com>2021-12-15 23:49:12 +0000
commitb748acf2a04b756ba14e4258159e7f292fc5c4c0 (patch)
tree4e7222c3f0e96109d8500b04c031240021574d09 /modules/markup/markdown
parentf58e687a83b18d58298097d485f4febf98062dd7 (diff)
downloadgitea-b748acf2a04b756ba14e4258159e7f292fc5c4c0.tar.gz
gitea-b748acf2a04b756ba14e4258159e7f292fc5c4c0.zip
Fixed emoji alias not parsed in links (#16221)
* Do not skip links. * Restrict text in links to emojis. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/markup/markdown')
-rw-r--r--modules/markup/markdown/markdown_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/markup/markdown/markdown_test.go b/modules/markup/markdown/markdown_test.go
index 936e4a39fd..083484813a 100644
--- a/modules/markup/markdown/markdown_test.go
+++ b/modules/markup/markdown/markdown_test.go
@@ -391,5 +391,13 @@ func TestRenderSiblingImages_Issue12925(t *testing.T) {
res, err := RenderRawString(&markup.RenderContext{}, testcase)
assert.NoError(t, err)
assert.Equal(t, expected, res)
+}
+func TestRenderEmojiInLinks_Issue12331(t *testing.T) {
+ testcase := `[Link with emoji :moon: in text](https://gitea.io)`
+ expected := `<p><a href="https://gitea.io" rel="nofollow">Link with emoji <span class="emoji" aria-label="waxing gibbous moon">🌔</span> in text</a></p>
+`
+ res, err := RenderString(&markup.RenderContext{}, testcase)
+ assert.NoError(t, err)
+ assert.Equal(t, expected, res)
}