pydanny / django-wysiwyg

A Django application for making Django textareas rich text editors. Certainly as a template tag and possibly as a form widget.
http://django-wysiwyg.readthedocs.org
MIT License
465 stars 63 forks source link

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

Open mrmachine opened 7 years ago

mrmachine commented 7 years ago

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
vdboor commented 7 years ago

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.