lib/microformats/absolute_uri.rb in microformats-4.0.0 vs lib/microformats/absolute_uri.rb in microformats-4.0.1
- old
+ new
@@ -8,12 +8,12 @@
@base.strip! unless @base.nil?
@relative.strip! unless @relative.nil?
end
def absolutize
- #TODO: i'm sure this could be improved a bit
- return nil if relative.nil? or relative == ""
+ return base if relative.nil? or relative == ""
return relative if relative =~ /^https?:\/\//
+ return base + relative if relative =~ /^#/
uri = URI.parse(relative)
if base && !uri.absolute?
uri = URI.join(base.to_s, relative.to_s)