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?
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
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>
is working on a reply...