Skip to content
Advertisement

How to break lines when using wagtail BlockQuoteBlock?

I have this model:

JavaScript

When I’m saving page with some text using blockquote I use some line breakes and even <br> tags:

enter image description here

But on the page there are no line breaks after it:

enter image description here

So how to make this work and save line breaks? I’m using wagtail 1.13.1.

Advertisement

Answer

I think it was done because of security reasons. But It is possible to solve the problem – redefine BlockQuoteBlock for example like this:

JavaScript

I’ve added mark_safe() function to the original implementation. And then use this block in the model, if you do so, then <br> tags begin to work

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement