parent
2496cece91
commit
45e8331e26
150 changed files with 610 additions and 609 deletions
14
src/api/common/text/elements/url.ts
Normal file
14
src/api/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