Add link to community on hashtags
This commit is contained in:
parent
60f5a40596
commit
f447ee29d4
|
@ -148,6 +148,10 @@ app.use((_req, res, next) => {
|
||||||
/(\s|^)(([a-z-_])*(\.[^\s.]{2,})+)/gm, // Domains without http
|
/(\s|^)(([a-z-_])*(\.[^\s.]{2,})+)/gm, // Domains without http
|
||||||
`$1<a target="_blank" href="http://$2">$2</a>`
|
`$1<a target="_blank" href="http://$2">$2</a>`
|
||||||
);
|
);
|
||||||
|
result = result.replace(
|
||||||
|
/(\s|^)#([a-z0-9-]+)/g, // Communities
|
||||||
|
`$1<a href="/communities/$2">#$2</a>`
|
||||||
|
);
|
||||||
result = result.replace(/\n/g, "<br />");
|
result = result.replace(/\n/g, "<br />");
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue