mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-27 04:17:51 -07:00
50a45ce1a1
* Add angle bracket covered url syntax to mfm * Fix path * Fix match * Fix index
10 lines
383 B
TypeScript
10 lines
383 B
TypeScript
// test is located in test/extract-mentions
|
|
|
|
import { MentionNode, MfmForest } from '../mfm/prelude';
|
|
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);
|
|
}
|