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

Error when passing instance of TextFilter class to text_filters option #400

Closed
aki77 opened this issue Apr 3, 2024 · 3 comments · Fixed by #401
Closed

Error when passing instance of TextFilter class to text_filters option #400

aki77 opened this issue Apr 3, 2024 · 3 comments · Fixed by #401

Comments

@aki77
Copy link

aki77 commented Apr 3, 2024

When passing an instance of the TextFilter class to the text_filters option as per the sample code, it results in a wrong number of arguments (given 2, expected 1) error.

Steps to Reproduce

pipeline = HTMLPipeline.new(text_filters: [ HTMLPipeline::TextFilter::PlainTextInputFilter.new])
pipeline.call('test')

Workaround

pipeline = HTMLPipeline.new(text_filters: [ HTMLPipeline::TextFilter::PlainTextInputFilter])
pipeline.call('test')

Additional Information

filter.call(doc, context: context, result: result)

@gjtorikian
Copy link
Owner

Which version of html-pipeline is this? Recently there was a change to this exact behavior—the latest version is 3.1.0. Could you try your example with that?

@aki77
Copy link
Author

aki77 commented Apr 9, 2024

Thank you for your response.
I'm using 3.1.0.
The issue arises because although keyword arguments are being passed to the call method, the TextFilter class's call method only accepts the text argument.

filter.call(doc, context: context, result: result)

@gjtorikian
Copy link
Owner

Gah, thank you for noticing that. 3.1.1 is released, fixing this.

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

Successfully merging a pull request may close this issue.

2 participants