diff --git a/pandora/annotation/utils.py b/pandora/annotation/utils.py index cfecb0f5..5d48fc87 100644 --- a/pandora/annotation/utils.py +++ b/pandora/annotation/utils.py @@ -5,7 +5,7 @@ import ox def cleanup_value(value, layer_type): #FIXME: what about other types? location etc if layer_type == 'text': - value = ox.sanitize_html(value) + value = ox.sanitize_html(value, global_attributes=['lang']) else: value = ox.escape_html(value) return value diff --git a/pandora/text/models.py b/pandora/text/models.py index 32ca7b26..de36af83 100644 --- a/pandora/text/models.py +++ b/pandora/text/models.py @@ -128,9 +128,9 @@ class Text(models.Model): name = data['name'] + ' [%d]' % num self.name = name elif key == 'description': - self.description = ox.sanitize_html(data['description']) + self.description = ox.sanitize_html(data['description'], global_attributes=['lang']) elif key == 'text': - self.text = ox.sanitize_html(data['text'], global_attributes=['data-name']) + self.text = ox.sanitize_html(data['text'], global_attributes=['data-name', 'lang']) elif key == 'rightslevel': self.rightslevel = int(data['rightslevel']) diff --git a/static/js/textPanel.js b/static/js/textPanel.js index e830a68d..8d62c304 100644 --- a/static/js/textPanel.js +++ b/static/js/textPanel.js @@ -312,7 +312,7 @@ pandora.ui.textHTML = function(text) { } ); }, - globalAttributes: ['data-name'], + globalAttributes: ['data-name', 'lang'], placeholder: text.editable ? Ox._('Doubleclick to edit text') : '', tooltip: text.editable ? pandora.getEditTooltip('text') : '', type: 'textarea',