Copied to clipboard

Flag this post as spam?

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


  • Probocop 51 posts 71 karma points
    Nov 16, 2010 @ 11:07
    Probocop
    0

    StripHtml not stripping HTML

    On a website I've developed I'm using the StripHtml library function in conjunction with the TruncateString for a list of news, but it doesn't seem to be removing an <a> tag. The TruncateString is limiting it to 250, but it's chopping it half way though the <a>, which is causing the HTML to break, but surely if I'm using StripHTML then the <a> shouldn't be there at all?

    My line of XSLT is as follows:

    <p><xsl:value-of select="umbraco.library:StripHtml(umbraco.library:TruncateString(data [@alias = 'bodyText'], 250, '...'))" disable-output-escaping="yes" /></p>

    Any idea why this would be happening?

    Thanks

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Nov 16, 2010 @ 11:28
    Stefan Kip
    3

    First you should strip the HTML, after that truncate the string:

    <p><xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml(data [@alias = 'bodyText']), 250, '...')" disable-output-escaping="yes" /></p>

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies