Commit 2d47ef78 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes html encoding of some characters by bleach.

parent 590ba2d8
import bleach
import logging
import html
from django.conf import settings
from django.db.utils import IntegrityError
......@@ -162,7 +163,9 @@ class LineTranscriptionSerializer(serializers.ModelSerializer):
'versions', 'version_author', 'version_source', 'version_updated_at')
def cleanup(self, data):
return bleach.clean(data, tags=['em', 'strong', 's', 'u'], strip=True)
nd = bleach.clean(data, tags=['em', 'strong', 's', 'u'], strip=True)
nd = html.unescape(nd)
return nd
def validate_content(self, content):
return self.cleanup(content)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment