fix: use correct regex to display instagram urls
This commit is contained in:
parent
83e032a590
commit
c72cd0f4ba
1 changed files with 1 additions and 1 deletions
|
|
@ -181,7 +181,7 @@ async function getAddressReverse(lat: number, long: number): Promise<string> {
|
||||||
|
|
||||||
function toLink(url: string): string {
|
function toLink(url: string): string {
|
||||||
let content = url;
|
let content = url;
|
||||||
const m = url.match("https://instagram.com/(.*)");
|
const m = url.match(/https:\/\/instagram\.com\/((?:\w|\.)+)\/?/);
|
||||||
if (m) {
|
if (m) {
|
||||||
content = `@${m[1]}`;
|
content = `@${m[1]}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue