WordPress.org

Making WordPress.org

Opened 12 months ago

Closed 7 weeks ago

#5155 closed defect (fixed)

Tighten the URL warnings

Reported by: dd32 Owned by: dd32
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:
Cc:

Description

On translate.wordpress.org we have two types of URL warnings

  • GlotPress mismatching tag warning which detect mis-matched <a href="..."> tags

and

  • A custom warning to detect URL changes outside of tags in the content

The latter allows for certain URL changes (ie. wordpress.org to fr.wordpress.org, and http to https) however the former doesn't.
We should extend the GlotPress warning to ignore any valid URL changes.

It also looks like we should probably ignore urls which only differ by a trailing slash being added, which while a change that may break a URL is highly unlikely to.

Change History (6)

#1 @dd32
2 months ago

In 10688:

Translate: Extend the GlotPress HTML warnings to allow certain URL domain changes.

This alows for <a href="http://wordpress.org/.."> to be translated to <a href="https://test.wordpress.org/.."> without generating a warning.

See #5155.

#2 @dd32
2 months ago

In 10689:

Translate: Allow for the trailing slash to be altered on plaintext urls.

This avoids triggering an error when http://wordpress.org is translated to https://wordpress.org/.

This will still trigger a warning on a trailing slash changing inside a HTML tag like <a href="..">.

See #5155.

#3 @dd32
7 weeks ago

  • Resolution set to fixed
  • Status changed from new to closed

#4 @dd32
7 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Would be great to better handle warnings like these:

The translation appears to be missing the following URLs: https://example.com</li><li>-
The translation contains the following unexpected URLs: https://example.com</li><li

URLs can include < but realistically it's not going to happen in translations.

#5 @dd32
7 weeks ago

In 10730:

Translate: Expand upon the GlotPress tag warnings to validate the href values separately to the rest of the tags.

This change also allows for the tags to be translated in any order, but doesn't validate the HTML is correctly nested (follow up change needed)

See #5155.

#6 @dd32
7 weeks ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from reopened to closed

In 10733:

Translate: When matching URLs in text, assume a URL will not contain a HTML tag, so exclude < from appearing within the URL.

Fixes #5155.

Note: See TracTickets for help on using tickets.