Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
create re-usable Cleaner class #125
While glancing at the source, the inner workings of
The current structure creates 2 object instances to clean a single bit of text. If you do a lot of cleaning to a standard configuration, a factory pattern works really well.
I tried something and set up a test suite to see if there would be a noticeable difference. html5lib tends to be bulky and annoying, and it often lends well to caching.
Using the factory pattern below to cache a "cleaner", we average a 15% speedup over the default
changed the title from
Docs suggestion, possible feature change
Docs suggestion, possible feature
Apr 29, 2014
I want to take a deeper look at Bleach's structure. It's always had the dubious honor of being my first major Python project, and there are lots of things I dislike, both from a code organizational standpoint (so much in
I don't know exactly when or how, but I want this to be a design consideration for bleach 2.0. Something closer to what you've done may be backported to 1.x once we've nailed down the API. (Though it depends on the EOL plan for 1.x.)