Make WordPress Core

Opened 5 years ago

Last modified 7 weeks ago

#52601 new defect (bug)

Link validation issue on TinyMCE using Classic Editor

Reported by: audrasjb's profile audrasjb Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 5.6
Component: Editor Keywords: 2nd-opinion
Focuses: javascript Cc:

Description

Just spotted a small issue on Classic Editor, during the 5.6.2 release party.
New links seem to have a data-wplink-url-error="true" attribute after they are inserted. It’s ok after the post is saved.

Attachments (1)

d4838ec441ea081d7847a7051ab8ca96.gif (1.0 MB) - added by audrasjb 5 years ago.

Download all attachments as: .zip

Change History (3)

#1 @sabernhardt
4 years ago

I think the error showed because the URL includes localhost (see ticket:36638#comment:47). I get the same error on my local installations.

The link validates positively when I try selecting a page on a site with public URLs, though.

#2 @sabernhardt
7 weeks ago

  • Focuses javascript added
  • Keywords 2nd-opinion added
  • Severity changed from normal to minor

@azaozz mentioned that localhost links 'should never appear on a "live" web page', but maybe it could be worth ignoring them in the checkLink() function.

if ( /^http/i.test( href ) && ( ! urlRegex1.test( href ) || ! urlRegex2.test( href ) ) && ( ! href.includes( '://localhost' ) ) ) {

Note: See TracTickets for help on using tickets.