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

Clarify cleaner doc on setting comments=False #177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JocelynDelalande
Copy link

Maybe the actual way to go is to remove this rule you seem not to be sure about. The sure thing is that the effect is quite unexpected for the library user: "I cannot disable comments removing".

@scoder
Copy link
Member

scoder commented Jul 24, 2016

I agree that it's unexpected. Not sure if we should break code by fixing this (it's been like that forever), but it feels like we should fix it in the code, rather than documenting weird behaviour.

@mlissner
Copy link
Contributor

It's worth reviewing this too: https://bugs.launchpad.net/lxml/+bug/1882606

Cleaner.clean_html() uses the default parser internally, which strips comments and PIs – before even passing the result through the cleaner. I admit that that may appear counter-intuitive. PR welcome to configure the parser based on the relevant Cleaner options.

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