Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix google_map for all countries

  • Loading branch information...
commit 7f6fc7e52f1d6cbf134475b34c843d0f60d6a7ce 1 parent 74652f0
Julien Grillot RubyBB authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/auto_html/filters/google_map.rb
4 lib/auto_html/filters/google_map.rb
View
@@ -1,6 +1,6 @@
# encoding: UTF-8
AutoHtml.add_filter(:google_map).with(:width => 420, :height => 315, :style => "color:#000;text-align:left", :link_text => "View Larger Map") do |text, options|
- regex = /(https?):\/\/maps\.google\.co(.*)\/maps\?(.*)/
+ regex = /(https?):\/\/maps\.google\.([a-z\.]+)\/maps\?(.*)/
text.gsub(regex) do
domain_country = $2
map_query = $3
@@ -8,6 +8,6 @@
height = options[:height]
style = options[:style]
link_text = options[:link_text]
- %{<iframe width="#{width}" height="#{height}" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="//maps.google.co#{domain_country}/maps?f=q&amp;source=s_q&amp;#{map_query}&amp;output=embed"></iframe><br /><small><a href="//maps.google.co#{domain_country}/maps?f=q&amp;source=embed&amp;#{map_query}" style="#{style}">#{link_text}</a></small>}
+ %{<iframe width="#{width}" height="#{height}" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="//maps.google.#{domain_country}/maps?f=q&amp;source=s_q&amp;#{map_query}&amp;output=embed"></iframe><br /><small><a href="//maps.google.#{domain_country}/maps?f=q&amp;source=embed&amp;#{map_query}" style="#{style}">#{link_text}</a></small>}
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.