Closed ppworks closed 9 months ago
I think actually the README is (aspirationaly) correct, and the code might be wrong. The other filters (node_filters
) do expect an object, so I am not sure why I had it such that a class needs to be passed here. 🤔
Yes I too think that assuming an object is natural.
However, in the current code, if I pass an object by new method, I get an error.
lib/html_pipeline/text_filter.rb:7:in
initialize': wrong number of arguments (given 0, expected 1) (ArgumentError)`
Maybe we should fix the code instead of the README 😄
Maybe we should fix the code instead of the README
Yep--I will do this when I get the chance! Thank you for noticing.
https://github.com/gjtorikian/html-pipeline/pull/398 will address this. Thanks for your PR and bringing this to my attention!
An error will occur if new is added to the class specified for text_filters.
Reading the source code, it appears that specifying the class is the correct behavior, so I changed the README.
Example