cantino / ruby-readability

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

Java::JavaLang::NullPointerException on JRuby #81

Open rsofista opened 7 years ago

rsofista commented 7 years ago

When you don't put 'div' as a tag in the initializer like:

require 'rubygems'
require 'readability'
require 'open-uri'

source = open('https://developers.google.com/custom-search/docs/tutorial/creatingcse').read
puts Readability::Document.new(source, tags: []).content

it trows the error: NullPointerException: from nokogiri.internals.SaveContextVisitor.isHtmlScript(SaveContextVisitor.java:741)

you can put any tags you want, if you don't add 'div' the error happens

using jruby-9.1.6.0 [ x86_64 ]