-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Cannot call append_attribute
in custom scrubber
#173
Comments
Hi, thanks for asking this question and raising these issues. Clearly it's not as easy as I've aspired to make it, so I appreciate the feedback. The Until I fix that, though you may want to consider modifying the Sorry for the difficulties here. |
- #kwattr_values - #kwattr_add - #kwattr_append - #kwattr_remove and rewrite CSS class convenience methods using their #kwattr analog. related to flavorjones/loofah#173
Please note that I've started work adding this functionality to Nokogiri::XML::Node under this PR (still in progress): sparklemotion/nokogiri#2000 |
Just closing the loop here: Nokogiri v1.11.0.rc2 (when it comes out in a few days) will have a method If you're interested, I'd totally accept a pull request adding a Thanks again for your patience and for taking the time to call my attention to this problem. Is there anything else I can do to help? |
I'm trying to write a
noreferrer
scrubber, in the manner of thenofollow
andnoopener
ones supplied.The following code looks like it should work, but fails:
with
NoMethodError: undefined method
append_attribute' for Loofah::Scrubber:Class`.I've tried just putting
append_attribute
— it doesn't look in Loofah at all, but instead uses the caller's context.Placing this at the start of the helper file instead and replacing the call with
scrub!(:noreferrer)
also fails:with
Loofah::ScrubberNotFound: not a Scrubber or a scrubber name: :noreferrer
— there doesn't seem to be anything in the documentation to tell me how to get Loofah to add the symbol for the new scrubber here.Please could somebody tell me how to create a scrubber that uses
append_attribute
, short of copying theappend_attribute
definition into my own code?Could I also gently suggest that, at times of frustration like this, seeing
It's super-easy to write your own custom scrubbers for whatever document manipulation you need.
in the README is not helpful — it reads like "everyone else has managed this — what are you, thick?"The text was updated successfully, but these errors were encountered: