开发者

Django comments taking out new lines

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 a开发者_StackOverflowround a bit in Django-comments code but haven't found anything yet that could be overridden.

Thanks


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜