Opened 7 years ago

Last modified 7 years ago

#14425 closed enhancement

(patch) Improve Wikipedia tag validators — at Version 2

Reported by: nyurik Owned by: team
Priority: normal Milestone: 17.03
Component: Core validator Version:
Keywords: , wikipedia Cc:

Description (last modified by nyurik)

Wikipedia tags need a few more validators with fixers:

  • update the list of valid Wikipedia languages
  • auto-replace language be-x-old with be-tarask
  • auto-replace language cz with cs
  • remove space before page title ("en: Foo" -> "en:Foo")
  • replace "_" with spaces ("en:Foo_bar" -> "en:Foo bar")
  • replace "_" with spaces ("en:Foo_bar" -> "en:Foo bar")
  • capitalize first letter if it's not "jbo" language ("en:foo" -> "en:Foo")
  • double language link ("en:en:Foo" -> "en:Foo")
      This part is not implemented because it requires regex backreferences in validators,
      which don't work for some reason:  *[wikipedia =~ /^([-a-z]{2,12}:)\1/] {...}
    

This patch also adds a few additional validator functions: trim, upper and lower (for completeness)

Change History (3)

by nyurik, 7 years ago

Attachment: wikipedia-validations.patch added

patch to fix this issue

comment:1 by nyurik, 7 years ago

Description: modified (diff)

comment:2 by nyurik, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.