Copied to clipboard

Flag this post as spam?

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


  • wayferer 9 posts 50 karma points
    Jun 27, 2014 @ 19:13
    wayferer
    0

    Line breaks in text block

    I am using the default text block that comes with Sir Trevor but I can't figure out how to add linebreaks in the back office so they will render correctly in the front-end. Here is the snippet I am using to get the content.

    @foreach(dynamic block in @CurrentPage.Content.data){
                    switch((string)block.type)
                    {
                        case "heading":
                        string heading = block.data.text;
                        <h2>@heading</h2>
                        break;
                        case "text":
                        string text = block.data.text;
                        @SirTrevor.Markdown(text)
                        break;
                        case "list":
                        string list = block.data.text;
                        @SirTrevor.Markdown(list)
                        break;
                    }
                }
    

    Thanks in advance.

  • Marc Stöcker 104 posts 550 karma points c-trib
    Jun 29, 2014 @ 12:32
    Marc Stöcker
    101

    SirTrevor uses Markdown for texts, so placing two or more spaces at the end of the line should work.

Please Sign in or register to post replies

Write your reply to:

Draft