underpantsgnome / hpricot_scrub Goto Github PK
View Code? Open in Web Editor NEWStrip and sanitize HTML with Hpricot
Strip and sanitize HTML with Hpricot
Hello,
I'm trying to install the latest version on a Windows XP system bu the following error occurs:
ERROR: Error installing gem hpricot_scrub-0.3.7.gem[.gem]: buffer error
Any help?
Thanks
Emi
/usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:209:in scrub': undefined method
scrubbable?' for #Hpricot::ProcIns:0x7f0a402f20a0 (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in each' from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in
scrub'
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:209:in scrub' from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in
each'
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in scrub' from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:209:in
scrub'
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in each' from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:208:in
scrub'
... 13 levels...
when calling scrub on an empty (nil) hpricot object, hpricot_scrub fails.
here is the error message:
/usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:256:in scrub': undefined method
reverse' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:268:in scrub!' from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:272:in
scrub'
here is a fix: (line 256 of hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb)
def scrub(config=nil)
config = Scrub::normalize_config(config)
if children
children.reverse.each do |child|
child.scrub(config) if child.scrubbable?
end
end
return self
end
regards,
parasew
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.