Maybe my expectations are incorrect, but when I figured the treatTagsAsContent=false will parse text but ignore the surrounding HTML, I was getting weird results so I started digging in:
I was working on a template that uses @Umbraco.Truncate on an RTE property and it appears that this method is incorrectly counting both the end '>' on tags as well as any attributes within the tag (ie class).
Poking through the 7.1.3 source I did get the expected behavior by commenting out the following lines in Umbraco.Web.UmbracoHelper.cs:
1182 to fix the end tag issue (<p>Lorem... would truncate to one less char than asked for)
1221 to fix the issue I was seeing with classes (<p><span class="a">Lorem.... would truncate to empty)
I didn't really step through the code to see why it's freaking out for me with classes, so I'm sure there's a better fix.
UmbracoHelper Truncate not ignoring tags properly?
Maybe my expectations are incorrect, but when I figured the treatTagsAsContent=false will parse text but ignore the surrounding HTML, I was getting weird results so I started digging in:
I was working on a template that uses @Umbraco.Truncate on an RTE property and it appears that this method is incorrectly counting both the end '>' on tags as well as any attributes within the tag (ie class).
Poking through the 7.1.3 source I did get the expected behavior by commenting out the following lines in Umbraco.Web.UmbracoHelper.cs:
1182 to fix the end tag issue (<p>Lorem... would truncate to one less char than asked for)
1221 to fix the issue I was seeing with classes (<p><span class="a">Lorem.... would truncate to empty)
I didn't really step through the code to see why it's freaking out for me with classes, so I'm sure there's a better fix.
I am having the same issue.
Thanks for posting
is working on a reply...