summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5f1fc76)
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)
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
if key == "wikipedia"
# This regex should match Wikipedia language codes, everything
# from de to zh-classical
- # 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
return {
:url => "http://#{lang}.wikipedia.org/wiki/#{value}?uselang=#{I18n.locale}",
:title => value