Abolish common and misc directories
This commit is contained in:
parent
a0f8b4e940
commit
5b9f3701f5
111 changed files with 133 additions and 133 deletions
14
src/text/parse/elements/url.ts
Normal file
14
src/text/parse/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