Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `lstrip' for :Loofah::HTML::DocumentFragment #5

Closed
technicalpickles opened this issue Aug 13, 2009 · 4 comments
Closed

Comments

@technicalpickles
Copy link
Contributor

undefined method `lstrip' for :Loofah::HTML::DocumentFragment
/gentoo/usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/fragment_handler.rb:21:in `initialize'
/gentoo/usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/document_fragment.rb:7:in `new'
/gentoo/usr/lib/ruby/gems/1.8/gems/nokogiri-1.3.3/lib/nokogiri/xml/document_fragment.rb:7:in `initialize'
/gentoo/usr/lib/ruby/gems/1.8/gems/loofah-0.2.0/lib/loofah/html/document_fragment.rb:18:in `new'
/gentoo/usr/lib/ruby/gems/1.8/gems/loofah-0.2.0/lib/loofah/html/document_fragment.rb:18:in `parse'
/gentoo/usr/lib/ruby/gems/1.8/gems/loofah-0.2.0/lib/loofah.rb:179:in `fragment'
/gentoo/usr/lib/ruby/gems/1.8/gems/loofah-0.2.0/lib/loofah.rb:184:in `scrub_fragment'
/gentoo/usr/lib/ruby/gems/1.8/gems/loofah-0.2.0/lib/loofah/active_record.rb:27:in `html_fragment'

The code that I was using:

html_fragment :content, :scrub => :whitewash
@technicalpickles
Copy link
Contributor Author

I haven't tracked down exactly why this is occurring, but it seems like it was happening when it loofah was scrubbing attributes that hadn't changed. Not sure how that makes sense though.

@flavorjones
Copy link
Owner

Thanks for the report. I will have a fix committed for this tonight.

@technicalpickles
Copy link
Contributor Author

I did this workaround for it: http://github.com/technicalpickles/loofah/tree/only-scrub-when-changed

It's still pretty unclear why it was getting a DocumentFragment way down there instead of a string though when the field wasn't changed.

@flavorjones
Copy link
Owner

active record extension returns strings, and not Nokogiri objects. closed by b88f6d5.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants