mirror of
https://codeberg.org/yeentown/barkey
synced 2024-12-02 18:07:27 +00:00
14 lines
233 B
JavaScript
14 lines
233 B
JavaScript
/**
|
|
* Mention
|
|
*/
|
|
|
|
module.exports = text => {
|
|
const match = text.match(/^@[a-zA-Z0-9\-]+/);
|
|
if (!match) return null;
|
|
const mention = match[0];
|
|
return {
|
|
type: 'mention',
|
|
content: mention,
|
|
username: mention.substr(1)
|
|
};
|
|
};
|