forked from forgejo/forgejo
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>
This commit is contained in:
parent
f58e687a83
commit
b748acf2a0
2 changed files with 17 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue