Next to QuoteHTML:
sub QuoteUrl { my ($url) = @_; $url =~ s/ /+/g; $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg; return $url; }
Around CommonMarkup:
sub GoogleMaps { my ($address) = @_; my $text = $address; $address =~ s/\bwest\b/W/i; $address =~ s/\beast\b/E/i; $address =~ s/\bnorth\b/N/i; $address =~ s/\bsouth\b/S/i; $address = &QuoteUrl($address); return &StoreRaw("<a href='http://maps.google.com/maps?q=$address'>Map:\"$text\"</a>"); }
Somewhere in CommonMarkup:
s@Map:\"([^\"]+)"@&GoogleMaps($1)@eg;