Copied to clipboard

Flag this post as spam?

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


  • Sandro 45 posts 118 karma points c-trib
    Sep 04, 2012 @ 19:33
    Sandro
    0

    Macro content rendering in editor ignores newlines

    I have an XSLT macro that prints out a code sample like this:

    <pre>
    <code>
    public interface IRequestProcessor
    {
        HttpResponse ProcessRequest();
    }
    </code>
    </pre>

    This works correct on the website. But when I render the macro in the backend editor, it seems to ignore the \n character and looks like this:

    Can I change this behaviour? I don't want it to ignore the newlines.

  • Drew 165 posts 340 karma points
    Sep 05, 2012 @ 15:16
    Drew
    0

    How is you macro outputting the content?

    If you're using xsl:value-of, are you also using  disable-output-escaping="yes"  ?

     

    Cheers,
    Drew 

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 06, 2012 @ 17:22
    Tom Fulton
    0

    You also might try just adding <br/> tags at the end of each line, not sure if there is another way around it.

  • Sandro 45 posts 118 karma points c-trib
    Sep 11, 2012 @ 11:13
    Sandro
    0

    The Output is a <pre> Element, so

    disable-output-escaping="yes" won't escape the HTML brackets and <br /> won't work as a line break.

    Any other ideas? The XSLT/Macro itself works fine on the site. I have only the issue with the macro rendering in the backend editor.

     

Please Sign in or register to post replies

Write your reply to:

Draft