[openstreetmap/openstreetmap-website] Remove secondary wiki prefix list (PR #7136)

Pablo Brasero notifications at github.com
Wed Jun 17 13:09:43 UTC 2026


@pablobm commented on this pull request.



> @@ -1,9 +1,11 @@
 # frozen_string_literal: true
 
 module BrowseTagsHelper
-  # https://wiki.openstreetmap.org/wiki/Key:wikipedia#Secondary_Wikipedia_links
-  # https://wiki.openstreetmap.org/wiki/Key:wikidata#Secondary_Wikidata_links
-  SECONDARY_WIKI_PREFIXES = "architect|artist|brand|buried|flag|genus|manufacturer|model|(?:official_|old_)?name:etymology|network|(?:heritage:|old_)?operator|owner|species|subject|taxon"
+  SECONDARY_WIKI_PREFIX_PATTERN = /[a-z:_-]+:/
+  QID_PATTERN = /[Qq][1-9][0-9]*/
+
+  # regex to match all wikipedia locale project identifiers
+  WIKIPEDIA_PROJECT_IDENTIFIER_PATTERN = /([a-z]{2,3}(?:-[a-z]{2,3})?|be-tarask|roa-tara|simple|zh-classical|zh-min-nan)/

What do you think of moving the outermost parentheses out of this constant, into each use of it, so that it's clearer what `Regexp.last_match(3)`, etc refers to?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7136#pullrequestreview-4515848246
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7136/review/4515848246 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260617/6a67ea1a/attachment.htm>


More information about the rails-dev mailing list