parent
3a030b2d78
commit
f1bc4a76c5
|
@ -96,32 +96,7 @@ module Anemone
|
|||
# MODIFIED: Dig URLs from elements other than "A" refs
|
||||
#
|
||||
def links
|
||||
return @links if @links
|
||||
@links = []
|
||||
return @links if !doc
|
||||
|
||||
@links = run_extractors
|
||||
|
||||
@links |= @links.map do |u|
|
||||
# back-off to the parent dir
|
||||
to_absolute( URI( u.path.gsub( /(.*\/)[^\/]+$/, "\\1" ) ) ) rescue next
|
||||
end.uniq.compact
|
||||
|
||||
nlinks = []
|
||||
@links.each do |u|
|
||||
bits = u.path.split('/')
|
||||
while(bits.length > 0)
|
||||
bits.pop
|
||||
j = bits.join('/')
|
||||
j = '/' if j.empty?
|
||||
nlinks << to_absolute(URI(j)) rescue next
|
||||
end
|
||||
end
|
||||
@links |= nlinks
|
||||
|
||||
@links.flatten!
|
||||
@links.uniq!
|
||||
@links
|
||||
@links ||= run_extractors
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue