Skip to content
This repository
Browse code

Fix google_map for all countries

  • Loading branch information...
commit 7f6fc7e52f1d6cbf134475b34c843d0f60d6a7ce 1 parent 74652f0
Julien Grillot RubyBB authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 lib/auto_html/filters/google_map.rb
4 lib/auto_html/filters/google_map.rb
... ... @@ -1,6 +1,6 @@
1 1 # encoding: UTF-8
2 2 AutoHtml.add_filter(:google_map).with(:width => 420, :height => 315, :style => "color:#000;text-align:left", :link_text => "View Larger Map") do |text, options|
3   - regex = /(https?):\/\/maps\.google\.co(.*)\/maps\?(.*)/
  3 + regex = /(https?):\/\/maps\.google\.([a-z\.]+)\/maps\?(.*)/
4 4 text.gsub(regex) do
5 5 domain_country = $2
6 6 map_query = $3
@@ -8,6 +8,6 @@
8 8 height = options[:height]
9 9 style = options[:style]
10 10 link_text = options[:link_text]
11   - %{<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>}
  11 + %{<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>}
12 12 end
13 13 end

0 comments on commit 7f6fc7e

Please sign in to comment.
Something went wrong with that request. Please try again.