4

So I've been working with Django-comments and I'm pretty happy, but a friend pointed out 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 would be saved and displayed as:

line1 line2 line3

Has anyone using Django realized this and figured out how to get around Django taking out new lines? I've poked around a bit in Django-comments code but haven't found anything yet that could be overridden.

Thanks

Luke
  • 2,053
  • 1
  • 18
  • 25
  • yeah, I've tried putting
    in the comment and it does nothing. Plus I don't want users having to put
    in their comments when they want a new line anyway. That'd be silly.
    – Luke Jul 28 '11 at 21:02

1 Answers1

5

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

Ismail Badawi
  • 36,054
  • 7
  • 85
  • 97
  • It's funny but I'm pretty sure I've read that before. It's exactly what I needed. Thanks. – Luke Jul 28 '11 at 21:11