From 79d1bf30a49e1fd1ef1f8b743a9aff84d104fb89 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 21 Jun 2018 01:21:57 +0900 Subject: リモートユーザーのHTMLで表現されたプロフィールをMFMに変換するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/text/parse/elements/link.ts | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/text/parse/elements/link.ts (limited to 'src/text/parse/elements/link.ts') diff --git a/src/text/parse/elements/link.ts b/src/text/parse/elements/link.ts deleted file mode 100644 index b353aebc5c..0000000000 --- a/src/text/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[0] == '?'; - 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; -} -- cgit v1.2.3-freya