blob: 2025dfdaaddb2faf24908c97e347d378376e705c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/**
* Mention
*/
import parseAcct from '../../../../common/user/parse-acct';
module.exports = text => {
const match = text.match(/^(?:@[a-zA-Z0-9\-]+){1,2}/);
if (!match) return null;
const mention = match[0];
const { username, host } = parseAcct(mention.substr(1));
return {
type: 'mention',
content: mention,
username,
host
};
};
|