整理した
This commit is contained in:
parent
8a279a4656
commit
cf33e483f7
552 changed files with 360 additions and 1311 deletions
19
src/common/text/elements/link.ts
Normal file
19
src/common/text/elements/link.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Link
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
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
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue