microformats2/lib/microformats2/property/url.rb
Jeena 6c90f01ae7 Resolve relative URLs (bugfix)
When the <base> tag is used, the @base wasn't handed down all the way to URLs
and photos, this patch fixes this problem.

In addition to that it also makes it possible to handle u-url on <input> tags.
2015-08-21 21:17:54 +02:00

23 lines
454 B
Ruby

module Microformats2
module Property
class Url < Foundation
def to_s
@to_s = Microformats2::AbsoluteUri.new(@base, super.to_s).absolutize
end
protected
def attr_map
@attr_map = {
"a" => "href",
"area" => "href",
"img" => "src",
"object" => "data",
"abbr" => "title",
"data" => "value",
"input" => "value" }
end
end
end
end