Bail out straight away if the tag value is a URL rather than waiting
until we have parsed the key as we may change the value in the process
of parsing the key.
end
def wikipedia_link(key, value)
+ # Some k/v's are wikipedia=http://en.wikipedia.org/wiki/Full%20URL
+ return nil if value =~ /^http:\/\//
+
if key == "wikipedia"
# This regex should match Wikipedia language codes, everything
# from de to zh-classical
return nil
end
- # Some k/v's are wikipedia=http://en.wikipedia.org/wiki/Full%20URL
- return nil if value =~ /^http:\/\//
-
return {
:url => "http://#{lang}.wikipedia.org/wiki/#{value}?uselang=#{I18n.locale}",
:title => value