Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links no longer clickable when using latest Skript version with Json fixes #543

Closed
bloggy opened this issue May 2, 2017 · 6 comments
Closed
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.

Comments

@bloggy
Copy link

bloggy commented May 2, 2017

Players are unable to click on any links in minecraft chat when using latest skript version.
Had to remove skript and replace it with older version of skript to make it work again.

Also players are unable to click on any betonquest answer of NPCs. Looks like similar issue here.

@TheBentoBox
Copy link
Member

@bensku The problem is that links currently must start with https:// for it to parse them as a link (according to the dev26f release notes), even though vanilla by default tries to parse basically anyone word containing a period as a link, e.g. saying "hey.how are you?" would try to parse "hey.how" as a URL. Even though it means some non-links will be registered as links, it's completely harmless and ensures that you don't have to have a full complete URL for it to parse (e.g. I can just say "go to github.com" and it'd work).

I'd recommend changing the URL parsing to happen for every word where a contains check for "." returns true as opposed to checking the beginning of the message for "https://".

@TheBentoBox TheBentoBox added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label May 2, 2017
@Snow-Pyon
Copy link

@TheBentoBox it just parse links with http:// or https://, not everything with a dot.

@TheBentoBox
Copy link
Member

@Snow-Pyon In vanilla you're correct, but otherwise you're not. This is a test in dev25 of me sending a URL without http[s]:// and it works:

image

And it even works on URLs that don't have valid extensions like .com, .gov, etc.:

image

That being the case, it should still work like this in dev26 too.

@bensku
Copy link
Member

bensku commented May 3, 2017

Ouch, time to rewrite link parsing once again... At least it should be relative simple.

bensku added a commit that referenced this issue May 3, 2017
@bensku
Copy link
Member

bensku commented May 3, 2017

I have resolved this problem (will be in next build). Now, there are three possible link parsing modes:

  • Disabled: doesn't parse links
  • Strict: parses links which have correct protocol at start
  • Lenient: parses anything which contains a dot as potential link and assumes the protocol is HTTP if not present

For old config files, false==disabled and true==lenient.

@TheBentoBox
Copy link
Member

Nice implementation, you're a legend

@bensku bensku closed this as completed May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

No branches or pull requests

4 participants