Skip to content

Commit

Permalink
Merge pull request jaimeiniesta#11 from rromanchuk/fix-malformed-img-…
Browse files Browse the repository at this point in the history
…fatal

do not fatal on malformed image tags
  • Loading branch information
jaimeiniesta committed Sep 26, 2011
2 parents b8c3f6d + 20e8037 commit 0e6ace2
Show file tree
Hide file tree
Showing 3 changed files with 3,619 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/meta_inspector/scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def links
end

def images
@data.images ||= parsed_document.search('//img').map{ |i| i.attributes['src'].value }.uniq
@data.images ||= parsed_document.search('//img')
.reject{|i| i.attributes['src'].blank? }
.map{ |i| i.attributes['src'].value }.uniq
end

# Returns the links converted to absolute urls
Expand Down
Loading

0 comments on commit 0e6ace2

Please sign in to comment.