Adventure Game Studio

AGS Development => Site & Forum Reports => Topic started by: Babar on Thu 08/06/2023 12:04:02

Title: Mentioning websites seems broken
Post by: Babar on Thu 08/06/2023 12:04:02
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.
Title: Re: Mentioning websites seems broken
Post by: eri0o on Thu 08/06/2023 18:44:58
Did you make an actual hyperlink or is this the autogenerated ones that I think are not possible to disable? (https://www.adventuregamestudio.co.uk/forums/site-forum-reports/strange-hyperlink-created-when-typing-ags-script-names/)
Title: Re: Mentioning websites seems broken
Post by: AGA on Thu 08/06/2023 22:04:22
Facebook.co.uk (facebook.co.uk)

https://www.facebook.co.uk

Works fine if you type an actual URL, so do that!
Title: Re: Mentioning websites seems broken
Post by: Babar on Fri 09/06/2023 08:30:02
No, I didn't make an actual hyperlink, was just casually mentioning the link.
Title: Re: Mentioning websites seems broken
Post by: Khris on Fri 09/06/2023 10:39:24
Here's code that fixes these broken links:

Code (javascript) Select
  document.querySelectorAll("a.bbc_link").forEach(a =>  {
    const parts = a.href.split(/\/\/\//);
    if (parts.length > 1) a.href="//" + parts[1];
  });
Title: Re: Mentioning websites seems broken
Post by: AGA on Sat 10/06/2023 13:38:07
Quote from: Khris on Fri 09/06/2023 10:39:24Here's code that fixes these broken links:

Code (javascript) Select
  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.