fix: use correct regex to display instagram urls (#50)

Reviewed-on: #50
Co-authored-by: Felipe Contreras Salinas <felipe@bstr.cl>
Co-committed-by: Felipe Contreras Salinas <felipe@bstr.cl>
This commit is contained in:
Felipe 2025-06-14 18:43:57 -04:00 committed by Felipe
parent 83e032a590
commit bf30b4f491
Signed by: Ludwig
GPG key ID: 441A26F83D31FAFF

View file

@ -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]}`;
} }