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

feature: allow Loofah-ization of an existing Nokogiri document or fragment #13

Open
flavorjones opened this issue Jan 22, 2010 · 1 comment
Labels

Comments

@flavorjones
Copy link
Owner

Currently, the following code will add scrubbing behavior:

doc = Nokogiri::HTML HTML
doc.extend Loofah::ScrubBehavior::Node

but that doesn't include #text or the node and node set decorators.

So, I'd suggest that we allow Loofah initialize methods to receive a Nokogiri document / fragment and do the extension there. Then we should check that we're not relying on the typeiness of the Loofah document / fragment.

(And, actually, can we then eliminate the classes entirely, and just use extended Nokogiri docs everywhere?)

@flavorjones
Copy link
Owner Author

see branch mixin-behavior

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

No branches or pull requests

1 participant