diff options
| author | gutfuckllc <40531868+gutfuckllc@users.noreply.github.com> | 2018-08-05 16:54:54 -0400 |
|---|---|---|
| committer | gutfuckllc <40531868+gutfuckllc@users.noreply.github.com> | 2018-08-05 16:54:54 -0400 |
| commit | 752186066b69c7cb13b6fc0db7fc69469e845d21 (patch) | |
| tree | caed5ac8ffd0b81a548b16c5ee79fd8e2af81907 /src/mfm/parse/elements | |
| parent | Removed start.sh (diff) | |
| parent | 非公開の投稿に自分以外が返信したりRenoteしたりできな... (diff) | |
| download | misskey-752186066b69c7cb13b6fc0db7fc69469e845d21.tar.gz misskey-752186066b69c7cb13b6fc0db7fc69469e845d21.tar.bz2 misskey-752186066b69c7cb13b6fc0db7fc69469e845d21.zip | |
Merge remote-tracking branch 'upstream/master' into devel
Diffstat (limited to 'src/mfm/parse/elements')
| -rw-r--r-- | src/mfm/parse/elements/big.ts | 2 | ||||
| -rw-r--r-- | src/mfm/parse/elements/motion.ts | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/mfm/parse/elements/big.ts b/src/mfm/parse/elements/big.ts index ca798986e9..8e39c75a55 100644 --- a/src/mfm/parse/elements/big.ts +++ b/src/mfm/parse/elements/big.ts @@ -1,5 +1,5 @@ /** - * Bold + * Big */ export type TextElementBig = { diff --git a/src/mfm/parse/elements/motion.ts b/src/mfm/parse/elements/motion.ts new file mode 100644 index 0000000000..9e7370e071 --- /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(/^\(\(\((.+?)\)\)\)/) || text.match(/^<motion>(.+?)<\/motion>/); + if (!match) return null; + const motion = match[0]; + return { + type: 'motion', + content: motion, + motion: match[1] + } as TextElementMotion; +} |