mirror of
https://github.com/outline/outline.git
synced 2025-12-17 16:54:31 -06:00
13 lines
301 B
TypeScript
13 lines
301 B
TypeScript
const parseMentionUrl = (url: string) => {
|
|
const matches = url.match(
|
|
/^mention:\/\/([a-z0-9-]+)\/([a-z]+)\/([a-z0-9-]+)$/
|
|
);
|
|
if (!matches) {
|
|
return {};
|
|
}
|
|
const [id, mentionType, modelId] = matches.slice(1);
|
|
return { id, mentionType, modelId };
|
|
};
|
|
|
|
export default parseMentionUrl;
|