Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • davelane 29 posts 73 karma points
    Dec 15, 2012 @ 21:30
    davelane
    0

    uBlogsy comments displayed without line breaks

    Hi there, I haven't been able to find anything elsewhere so hopefully someone can help.

    Comments to my blog posts are being displayed on my website as one line (paragraph) of text, rather than with their appropriate line breaks.

    Is there any way I can perhaps convert the linebreaks in the comment to <br /> tags?

    Thanks!
    Dave

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 15, 2012 @ 22:03
    Anthony Dang
    0

    You'll have to modify the macroscript to replace \n with <br />

  • davelane 29 posts 73 karma points
    Dec 15, 2012 @ 22:12
    davelane
    0

    Thanks Anthony,

    I should have mentioned what I've tried already. Basically I found the line of code in the macro (uBlogsyListComments.cshtml):

    <div class="uBlogsy_comment_message">@c.GetProperty("uBlogsyCommentMessage")</div>

    and tried to modify it based on a line of code I found on another forum:

    @Html .Raw(Html.Encode(Model.CommentText).Replace("\n", "<br />"))

    I'm not familiar with razor, so I'm pretty much stuck :P

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 16, 2012 @ 21:28
    Anthony Dang
    0
    @c.GetProperty("uBlogsyCommentMessage").Replace("\n", "<br />")
    or perhaps
    \r or both
Please Sign in or register to post replies

Write your reply to:

Draft