diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-08-05 12:33:51 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-08-05 12:33:51 +0900 |
| commit | cd28504dd8e4623ed864de2ad76e88e1022b08b1 (patch) | |
| tree | 3b0553c92b6e5d10478e565817c766a9ad1a5859 /src/mfm/parse/elements | |
| parent | Merge branch 'master' of https://github.com/syuilo/misskey (diff) | |
| download | misskey-cd28504dd8e4623ed864de2ad76e88e1022b08b1.tar.gz misskey-cd28504dd8e4623ed864de2ad76e88e1022b08b1.tar.bz2 misskey-cd28504dd8e4623ed864de2ad76e88e1022b08b1.zip | |
Add new MFM syntax
Diffstat (limited to 'src/mfm/parse/elements')
| -rw-r--r-- | src/mfm/parse/elements/motion.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mfm/parse/elements/motion.ts b/src/mfm/parse/elements/motion.ts new file mode 100644 index 0000000000..555a989750 --- /dev/null +++ b/src/mfm/parse/elements/motion.ts @@ -0,0 +1,20 @@ +/** + * Motion + */ + +export type TextElementMotion = { + type: 'motion' + content: string + motion: string +}; + +export default function(text: string) { + const match = text.match(/^\(\(\((.+?)\)\)\)/); + if (!match) return null; + const motion = match[0]; + return { + type: 'motion', + content: motion, + motion: match[1] + } as TextElementMotion; +} |