Skip to content

Remove disruptive regex for URL validation#191

Open
Fra146 wants to merge 1 commit into
godofredoninja:masterfrom
Fra146:master
Open

Remove disruptive regex for URL validation#191
Fra146 wants to merge 1 commit into
godofredoninja:masterfrom
Fra146:master

Conversation

@Fra146
Copy link
Copy Markdown

@Fra146 Fra146 commented Apr 18, 2026

The provided changes remove a very destructive regex.

I will provide the lighthouse reports for the before and after

image image Untitled

It would seem that this causes a recursion when checking for the validity of social media links. I'm unsure of when this happens exactly (on a blank site nothing happens) but on my full site it does slow the page down by 14 seconds.

@Fra146
Copy link
Copy Markdown
Author

Fra146 commented Apr 18, 2026

After more analysis it would seem that this regex is executed for each entry of the social media in the site footer
var followSocialMedia = {
instagram: ["https://www.instagram.com/verylongexamplestring?ref=example.it", "Example Site"],
}
That kind of instagram links makes the regex spiral into a very long recursion. (It's specifically the long link followed by the ?ref)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant