[openstreetmap/openstreetmap-website] Remove secondary wiki prefix list (PR #7136)
Tom Hughes
notifications at github.com
Sun Jun 7 18:14:32 UTC 2026
@tomhughes commented on this pull request.
> @@ -80,10 +76,13 @@ def wikipedia_links(key, value)
# Some k/v's are wikipedia=http://en.wikipedia.org/wiki/Full%20URL
return nil if %r{^https?://}.match?(value)
+ # regex to match all language codes from de to zh-classical
+ language_code_pattern = /[a-z]{1,2}[a-z-]{0,7}[a-z]{1,3}/
What exactly is this expected to match? Because that regex doesn't look anything like I'd expect for matching language codes...
A full language code is usually up to four items separated by `-` or `_` but I suspect wikipedia doesn't use them all. I would expect to see clear delimiters in the regex though.
> page_lang = Regexp.last_match(1)
title_section = Regexp.last_match(2)
else
+ return nil if lang.nil?
When would this be true? I can't see any path which leads to this?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7136#pullrequestreview-4445581693
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7136/review/4445581693 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260607/bf64d3e7/attachment.htm>
More information about the rails-dev
mailing list