For my blog, I want to be able to add css-classes to html-tags when I retrieve them from the DB.
For example, I have in the following in my DB, in a column called body:
<p>
SO is great
</p>
Then I output it in the View, with sth like this:
{{ blogpost.body }}
But what I actually want to have is this:
<p class="class1 class2 class3">
SO is great
</p>
How can I do this?
I can only think of using JS and adding the classes but I don't like this idea.
Is there maybe a way to pre-format it and save it ready in the DB? Or is this a bad practice?
Any suggestions are welcome.