Using Wagtail 2.16.1, I have a BlogPage
model that contains a body
field which is a RichTextField
.
When I put {{ page.body|richtext }}
into the template, the HTML that is rendered contains various html elements, as expected. I'd like to specify (tailwind) classes for these elements.
E.g. every <p>
element in a richtextfield should have <p class="mx-2 my-3">
, h2 elements should have <h2 class="mt-5">
, etc.