summaryrefslogtreecommitdiff
path: root/src/mfm/parse/elements/link.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/mfm/parse/elements/link.ts')
-rw-r--r--src/mfm/parse/elements/link.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/mfm/parse/elements/link.ts b/src/mfm/parse/elements/link.ts
deleted file mode 100644
index 972fce3810..0000000000
--- a/src/mfm/parse/elements/link.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Link
- */
-
-export type TextElementLink = {
- type: 'link';
- content: string;
- title: string;
- url: string;
- silent: boolean;
-};
-
-export default function(text: string) {
- const match = text.match(/^\??\[([^\[\]]+?)\]\((https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+?)\)/);
- if (!match) return null;
- const silent = text.startsWith('?');
- const link = match[0];
- const title = match[1];
- const url = match[2];
- return {
- type: 'link',
- content: link,
- title: title,
- url: url,
- silent: silent
- } as TextElementLink;
-}