draftail uses 'alignment' property on images instead of 'format'

This commit is contained in:
Matt Westcott 2017-12-12 15:09:41 +00:00 committed by Thibaud Colas
parent 3d435327b6
commit 0f10d42e92
2 changed files with 2 additions and 2 deletions

View file

@ -340,7 +340,7 @@ class TestHtmlToContentState(TestCase):
],
'entityMap': {
'0': {
'data': {'format': 'left', 'altText': 'an image', 'id': '1'},
'data': {'alignment': 'left', 'altText': 'an image', 'id': '1'},
'mutability': 'IMMUTABLE', 'type': 'IMAGE'
}
}

View file

@ -108,7 +108,7 @@ class ImageElementHandler(AtomicBlockEntityElementHandler):
to contentstate
"""
def create_entity(self, name, attrs, state, contentstate):
return Entity('IMAGE', 'IMMUTABLE', {'altText': attrs.get('alt'), 'id': attrs['id'], 'format': attrs['format']})
return Entity('IMAGE', 'IMMUTABLE', {'altText': attrs.get('alt'), 'id': attrs['id'], 'alignment': attrs['format']})
ContentstateImageConversionRule = {