Django comments on newlines

So, I worked with Django comments, and I am very pleased, but a friend noted that when he posted something that was longer and had new lines, Django took them out.

For example, if I posted:

line1 line2 line3 

Then it will be saved and displayed as:

 line1 line2 line3 

Has anyone using Django figured this out and figured out how to get around Django by pulling out newlines? I joked a bit in the Django-comments code, but have not yet found anything that could be overridden.

thanks

+4
source share
1 answer

Have you looked at linebreaks and linebreaksbr filters ? Instead of the render_comment_list tag render_comment_list you should use the get_comment_list tag to get a list of Comment objects, then you could pass the Comment attribute through the appropriate filter.

+5
source

All Articles