From fe4741e4e345323cae0fe4517cd544b61108fa78 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Tue, 21 Apr 2015 16:27:42 +0100 Subject: [PATCH] Do not skip whitelisting when converting 'div' elements to 'p' --- wagtail/wagtailcore/rich_text.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wagtail/wagtailcore/rich_text.py b/wagtail/wagtailcore/rich_text.py index d4ac8d6561..60159ca5ca 100644 --- a/wagtail/wagtailcore/rich_text.py +++ b/wagtail/wagtailcore/rich_text.py @@ -127,9 +127,10 @@ class DbWhitelister(Whitelister): link_attrs['linktype'] = link_type tag.attrs.clear() tag.attrs.update(**link_attrs) - elif tag.name == 'div': - tag.name = 'p' else: + if tag.name == 'div': + tag.name = 'p' + super(DbWhitelister, cls).clean_tag_node(doc, tag)