verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Add validation to link #262

Open lissomliksom opened 9 months ago

lissomliksom commented 9 months ago

Describe the bug

The "Insert Link"-option has two errors or possibly unintended behaviours:

  1. Inserting a link without text results in nothing showing. No link is inserted into the textarea. URL is required, but not Text. Consider adding required-property to text.
  2. Inserting a link without "https://" and only "www" results in broken links. Consider automatically adding "https://" if only "www" is present, or throw validation error on insert/save.

Steps to reproduce

First issue: No link insertion

  1. Click link icon
  2. Select Insert Link
  3. Add url, but no text
  4. Click insert-button

Link error #1

Second issue: www

  1. Click link icon
  2. Select Insert Link
  3. Add url starting with www
  4. Click insert-button.
  5. Preview entry and click link.

Link error #2

Craft CMS version

4.5.1

Plugin version

2.1.8

Multi-site?

No

Additional context

No response