verbb / hyper

A Craft CMS plugin for managing links, focusing on user experience.
Other
24 stars 15 forks source link

Using just a hash returns 'Link is not a valid URL.' #188

Open mattbloomfield opened 2 months ago

mattbloomfield commented 2 months ago

Describe the bug

Sometimes we just want to add a jump link on the page. I would expect to be able to add #jump-to-here as the input text on link field

Steps to reproduce

  1. Create a hyper field
  2. Add the following as a URL: `#my-custom-id
  3. Try to save the page

Craft CMS version

4.10.2

Plugin version

1.1.32

Multi-site?

No

Additional context

No response

engram-design commented 2 months ago

It's correct behaviour that # is not a valid URL. We define a valid URL by it being an absolute URL. It's the reason why things like mailto: links won't work as a URL, because they're technically not.

For this reason, you'd pick a "Custom" link type that has no validation, and is essentially a general purpose link for you to have whatever you like in it.