2018-12-20 04:41:04 -06:00
|
|
|
// test is located in test/extract-mentions
|
2018-12-18 20:16:29 -06:00
|
|
|
|
2019-03-14 07:23:15 -05:00
|
|
|
import { MentionNode, MfmForest } from '../mfm/prelude';
|
2018-12-20 04:41:04 -06:00
|
|
|
import { preorderF } from '../prelude/tree';
|
2018-12-18 20:16:29 -06:00
|
|
|
|
2018-12-20 04:41:04 -06:00
|
|
|
export default function(mfmForest: MfmForest): MentionNode['props'][] {
|
|
|
|
// TODO: 重複を削除
|
|
|
|
const mentionNodes = preorderF(mfmForest).filter(x => x.type === 'mention') as MentionNode[];
|
|
|
|
return mentionNodes.map(x => x.props);
|
2018-12-18 20:16:29 -06:00
|
|
|
}
|