Mentioning websites seems broken

Started by Babar, Thu 08/06/2023 12:04:02

Previous topic - Next topic

Babar

The example is from this forum post:
https://www.adventuregamestudio.co.uk/forums/index.php?msg=636655592


(Here I will try to do it now facebook.com)

Maybe it works without brackets facebook.com

Nope.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

eri0o


AGA

#2
Facebook.co.uk (facebook.co.uk)

https://www.facebook.co.uk

Works fine if you type an actual URL, so do that!

Babar

No, I didn't make an actual hyperlink, was just casually mentioning the link.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Khris

Here's code that fixes these broken links:

Code: javascript
  document.querySelectorAll("a.bbc_link").forEach(a =>  {
    const parts = a.href.split(/\/\/\//);
    if (parts.length > 1) a.href="//" + parts[1];
  });

AGA

Quote from: Khris on Fri 09/06/2023 10:39:24Here's code that fixes these broken links:

Code: javascript
  document.querySelectorAll("a.bbc_link").forEach(a =>  {
    const parts = a.href.split(/\/\/\//);
    if (parts.length > 1) a.href="//" + parts[1];
  });

Yet more @Khris magic!  I've implemented this, thanks.

SMF spam blocked by CleanTalk