cantino / ruby-readability

Port of arc90's readability project to Ruby
Apache License 2.0
919 stars 170 forks source link

images get hidden on doing .content #61

Open papriwalprateek opened 10 years ago

papriwalprateek commented 10 years ago

I wanted to display the content of the article as it is. That is, with image. Can this be implemented?

pagojo commented 10 years ago

The documentation states that you can do this:

rbody = Readability::Document.new(body, :tags => %w[div p img a], :attributes => %w[src href], :remove_empty_nodes => false)
rbody.images

If you can't then maybe you're hitting bug #51 which has been fixed and @cantino will merge as soon as he gets some cycles :-)

papriwalprateek commented 10 years ago

@pagojo I added your patch. But for http://www.algolist.net/Algorithms/Sorting/Bubble_sort, images are missing. Images are not returned while i do .images. While .prepare_candidates is returning it with the img tags. @cantino

cantino commented 10 years ago

I'm not sure, sorry. You may need to dig into the code.

On Wed, Jan 22, 2014 at 4:53 AM, papriwalprateek notifications@github.comwrote:

@pagojo https://github.com/pagojo I added your patch. But for http://www.algolist.net/Algorithms/Sorting/Bubble_sort, images are missing. Images are not returned while i do .images. While .prepare_candidates is returning it with the img tags. @cantino https://github.com/cantino

— Reply to this email directly or view it on GitHubhttps://github.com/cantino/ruby-readability/issues/61#issuecomment-33018799 .

papriwalprateek commented 10 years ago

In http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Sorting/heapSort.htm, the images in tags is not getting displayed. I tried debugging but am not able to figure out where it is getting stripped off in the code.

plcstevens commented 9 years ago

The links are relative so aren't displayed because it is looking for them on your website. Whereas they are only found on the domain.