MM-55267 Add ability for server-side Markdown code to understand emojis (#25332)

* MM-55267 Add ability for server-side Markdown code to understand emojis

* Remove unused regex
Этот коммит содержится в:
Harrison Healey
2023-11-13 14:38:05 -05:00
коммит произвёл GitHub
родитель 448d442a0b
Коммит 9397970644
5 изменённых файлов: 277 добавлений и 1 удалений

Просмотреть файл

@@ -101,6 +101,12 @@ func (i *Autolink) Destination() string {
return destination
}
type Emoji struct {
inlineBase
Name string
}
type delimiterType int
const (
@@ -575,12 +581,24 @@ func (p *inlineParser) Parse() []Inline {
p.parseLinkOrImageDelimiter()
case ']':
p.lookForLinkOrImage()
case 'w', 'W', ':':
case 'w', 'W':
matched := p.parseAutolink(c)
if !matched {
p.parseText()
}
case ':':
matched := p.parseAutolink(c)
if matched {
continue
}
matched = p.parseEmoji()
if matched {
continue
}
p.parseText()
default:
p.parseText()
}