Emoji support in profile (#3514)
* Emoji in profile * Add emojis to fields
This commit is contained in:
parent
fe891da886
commit
4522568749
41 changed files with 261 additions and 70 deletions
|
|
@ -64,6 +64,29 @@ const newline = P((input, i) => {
|
|||
}
|
||||
});
|
||||
|
||||
export const plainParser = P.createLanguage({
|
||||
root: r => P.alt(
|
||||
r.emoji,
|
||||
r.text
|
||||
).atLeast(1),
|
||||
|
||||
text: () => P.any.map(x => makeNode('text', { text: x })),
|
||||
|
||||
//#region Emoji
|
||||
emoji: r =>
|
||||
P.alt(
|
||||
P.regexp(/:([a-z0-9_+-]+):/i, 1)
|
||||
.map(x => makeNode('emoji', {
|
||||
name: x
|
||||
})),
|
||||
P.regexp(emojiRegex)
|
||||
.map(x => makeNode('emoji', {
|
||||
emoji: x
|
||||
})),
|
||||
),
|
||||
//#endregion
|
||||
});
|
||||
|
||||
const mfm = P.createLanguage({
|
||||
root: r => P.alt(
|
||||
r.big,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue