ruby-readability icon indicating copy to clipboard operation
ruby-readability copied to clipboard

images get hidden on doing .content

Open papriwalprateek opened this issue 11 years ago • 5 comments

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

papriwalprateek avatar Jan 15 '14 17:01 papriwalprateek

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 :-)

pagojo avatar Jan 22 '14 10:01 pagojo

@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

papriwalprateek avatar Jan 22 '14 12:01 papriwalprateek

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

On Wed, Jan 22, 2014 at 4:53 AM, papriwalprateek [email protected]:

@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 .

cantino avatar Jan 23 '14 04:01 cantino

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.

papriwalprateek avatar Feb 02 '14 20:02 papriwalprateek

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.

plcstevens avatar May 20 '15 11:05 plcstevens