Answer the question
In order to leave comments, you need to log in
Django 2. How to hide all html tags in text and still make them inactive using Django 2 tags?
I have a model that has an object of the TextField class. The fields of this class in the database can contain html tags that are used to insert links, images, select text colors, that is, you can use a text editor on the site, in my case I use the django-summernote application . But on one page, which has a block that displays the latest news, you need to hide all html tags, and at the same time make sure that they do not affect the block itself in any way. That is, so that all images, links, changes in color or text style are inactive, hidden. And it is desirable that when using the filter |truncatewords:30, hidden html tags, |truncatewords does not count as words.
Now:
Needed:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question