django-wysiwyg icon indicating copy to clipboard operation
django-wysiwyg copied to clipboard

Recent versions of html5lib have moved imports, breaking django-wysiwyg.

Open mrmachine opened this issue 8 years ago • 1 comments

Since https://github.com/html5lib/html5lib-python/pull/110 was merged, we get:

Traceback (most recent call last):
  File "/opt/django-icekit/icekit/plugins/text/tests.py", line 35, in test_sanitize_html5lib
    sanitized = sanitize_html(self.HTML1_ORIGINAL)
  File "/usr/local/lib/python2.7/dist-packages/django_wysiwyg/utils.py", line 41, in sanitize_html5lib
    from html5lib import treebuilders, treewalkers, serializer, sanitizer
ImportError: cannot import name sanitizer

mrmachine avatar Oct 07 '16 08:10 mrmachine

I've solved a similar issue here: https://github.com/django-fluent/django-fluent-contents/blob/master/fluent_contents/utils/html.py This could be useful to create a pull request, it supports both the old and new style.

vdboor avatar Oct 26 '16 18:10 vdboor