Simplify Microformats::Collection#absolutize
This commit is contained in:
parent
e630923e1d
commit
cdce96db13
1 changed files with 8 additions and 9 deletions
|
@ -112,12 +112,11 @@ module Microformats2
|
|||
def absolutize(href)
|
||||
uri = URI.parse(href)
|
||||
|
||||
if uri.scheme || @base.nil?
|
||||
uri = uri.normalize
|
||||
else
|
||||
if @base && !uri.absolute?
|
||||
uri = URI.join(@base, href)
|
||||
end
|
||||
|
||||
uri.normalize!
|
||||
uri.to_s
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue