Add new MFM animation

This commit is contained in:
syuilo 2020-11-02 15:16:37 +09:00
parent 666c8c0498
commit 09cab605fc
5 changed files with 33 additions and 0 deletions

View file

@ -76,6 +76,7 @@ export const mfmLanguage = P.createLanguage({
r.spin,
r.jump,
r.flip,
r.twitch,
r.inlineCode,
r.mathInline,
r.mention,
@ -122,6 +123,7 @@ export const mfmLanguage = P.createLanguage({
},
jump: r => P.regexp(/<jump>(.+?)<\/jump>/, 1).map(x => createTree('jump', r.inline.atLeast(1).tryParse(x), {})),
flip: r => P.regexp(/<flip>(.+?)<\/flip>/, 1).map(x => createTree('flip', r.inline.atLeast(1).tryParse(x), {})),
twitch: r => P.regexp(/<twitch>(.+?)<\/twitch>/, 1).map(x => createTree('twitch', r.inline.atLeast(1).tryParse(x), {})),
center: r => r.startOfLine.then(P.regexp(/<center>([\s\S]+?)<\/center>/, 1).map(x => createTree('center', r.inline.atLeast(1).tryParse(x), {}))),
inlineCode: () => P.regexp(/`([^´\n]+?)`/, 1).map(x => createLeaf('inlineCode', { code: x })),
mathBlock: r => r.startOfLine.then(P.regexp(/\\\[([\s\S]+?)\\\]/, 1).map(x => createLeaf('mathBlock', { formula: x.trim() }))),