You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@erikzenker It looks like it has been removed (or moved). Quickfix is to use a slightly older version of the package where sanitizer is still there:
pip install html5lib<0.99999999
ot: what is it with those weird version numbers anyway? You know you could also make it 0.10 .
Reacted by John Salvatore, Mario Colombo, sedrubal, Oleg Belousov, Hanno S, Nikita Shupeyko, Jonathan, SasoriOlkof, Thomas Meitz, Nikolay Bryzgalov and 1 more
That's #72 and #110. The sanitizer now exists only as a filter for the treewalkers, rather than something touching the tokenizer in odd ways that was likely broken.
Our state of terrible documentation probably doesn't help here, and the changelog entry is rather useless in hindsight. The common-case is something like:
from html5lib import parse, serialize
def clean(s):
d = parse(s)
return serialize(s, sanitize=True)
(0.10 is less than 0.9999999, so no, that option's long gone.)
You could make it 1.0 though. Counting the 9s makes me dizzy.
Reacted by ryneeverett, Axel H., Stefan Oderbolz, ex5, Florian Brucker, Mohammad Taleb, jhgjhtuytdfbnfvmnbgjtuydt, Yevhen Hostishchev, Martin Pajuste, Patrik Ragnarsson and 4 more
Reacted by Mario Colombo, Stefanie Taepke, Nikita Shupeyko and Ivan Gromov
Reacted by Tyson Clugg, Michael, Hanno S, Nikita Shupeyko and Leonhard Küper
Activity
stefanfoulis commentedon Jul 15, 2016
@erikzenker It looks like it has been removed (or moved). Quickfix is to use a slightly older version of the package where sanitizer is still there:
ot: what is it with those weird version numbers anyway? You know you could also make it 0.10 .
gsnedders commentedon Jul 15, 2016
That's #72 and #110. The sanitizer now exists only as a filter for the treewalkers, rather than something touching the tokenizer in odd ways that was likely broken.
Our state of terrible documentation probably doesn't help here, and the changelog entry is rather useless in hindsight. The common-case is something like:
(0.10 is less than 0.9999999, so no, that option's long gone.)
macolo commentedon Jul 18, 2016
You could make it 1.0 though. Counting the 9s makes me dizzy.
DanielTate commentedon Jan 30, 2017
This is still not working.... Are there any real solutions to this?
vhquang commentedon Mar 15, 2023
As a2917e9,
sanitizeris moved intofilters. So to import (as of version 1.1), you would do: