blob: 6ddd31004fe15c1fa6d361310bce78f1ec11ccd0 (
plain)
1
2
3
4
5
6
7
8
9
10
|
// test is located in test/extract-mentions
import { MentionNode, MfmForest } from '../mfm/types';
import { preorderF } from '../prelude/tree';
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);
}
|