整理した
This commit is contained in:
parent
8a279a4656
commit
cf33e483f7
552 changed files with 360 additions and 1311 deletions
14
src/common/text/elements/url.ts
Normal file
14
src/common/text/elements/url.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* URL
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+/);
|
||||
if (!match) return null;
|
||||
const url = match[0];
|
||||
return {
|
||||
type: 'url',
|
||||
content: url,
|
||||
url: url
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue