This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
*/
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+/);
|
||||
const match = text.match(/^https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+/);
|
||||
if (!match) return null;
|
||||
const link = match[0];
|
||||
const url = match[0];
|
||||
return {
|
||||
type: 'link',
|
||||
content: link
|
||||
type: 'url',
|
||||
content: url,
|
||||
url: url
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user