Hacksaw
ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Brett DeWoody
<a> Tags not closed causing issues with length of excerpt.
Bug Report
philecker
|
Posted: 25 July 2012 10:53 AM |
|
|
|
Having an issue with my <a> not being closed, which is causing my excerpt to be cutoff before the correct number of chars=”“, I saw another bug report of this same issue with other tags, is there a fix for this?
|
|
|
Sneed's Feed & Seed
|
Posted: 27 August 2012 04:15 PM |
# 1
|
|
|
I’m having this problem too. If the excerpt ends in the middle of a string wrapped in HTML tags, the ending tag gets cut off. My template code looks like this:
{exp:eehive_hacksaw chars="300" append="..." allow="<p><br /><strong><a><em>"} {blog_content} {/exp:eehive_hacksaw}
And one of my blog excerpts cuts off in the middle of a string wrapped in <em> tags, so the output looks like this:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vitae nunc nisi, non dictum elit. Fusce pulvinar porttitor volutpat. Duis quis mauris nulla, et ullamcorper nibh. Duis dolor ipsum, sodales sed ullamcorper ut, <em>commodo non sapien... <p><a href="/blog/my-blog-post">Continue Reading »</a></p>
|
|
|
philecker
|
Posted: 31 August 2012 07:52 PM |
# 2
|
|
|
Kristen,
Have you found solution to this issue? I’m still looking. Thanks.
-Phil
|
|
|
Sneed's Feed & Seed
|
Posted: 03 September 2012 09:03 AM |
# 3
|
|
|
Hi Phil,
I’m afraid not :( Looks like Brett isn’t actively supporting this add-on anymore. TruncHTML closes tags correctly but you don’t get to pick which tags are included.
|
|
|
philecker
|
Posted: 05 September 2012 09:07 AM |
# 4
|
|
|
Thanks Kristen,
I’ve tried to use TruncHTML before, but I need to remove any tags from my excerpts so they display correctly. I wish Brett supported this add-on.
-Phil
|
|
|
Sneed's Feed & Seed
|
Posted: 05 September 2012 09:42 AM |
# 5
|
|
|
Hey Phil. You could try CE String: http://www.causingeffect.com/software/expressionengine/ce-string It’s a little over-qualified and requires a little more configuration on your part, but it should get the job done if you’re really desperate for a solution.
UPDATE: Someone on Twitter also recommended combining TruncHTML and Strip HTML.
|
|
|
philecker
|
Posted: 05 September 2012 04:04 PM |
# 6
|
|
|
Thanks again Kristen, you’re right CE String is over qualified but worked PERFECTLY! Great solution. Thanks.
|
|
|
CreateSean
|
Posted: 15 June 2013 03:09 PM |
# 7
|
|
|
Bummer - no solution on this? First time I’ve encountered this bug.
|
|
|
Nicolas Bottari - Zenbu Studio
|
Posted: 15 December 2013 12:00 PM |
# 8
|
|
|
Happened to read this thread. If I recall correctly, I think the SuperGeekery Tag Stripper plugin allows to select which tags to remove, as well as closes unclosed tags that might occur after truncating text. That’s the plugin I use. Hope this helps! :)
|
|
|
Philip
|
Posted: 23 June 2014 09:34 PM |
# 9
|
|
|
Hey People - I needed this so I added it to a fork, and submitted a pull request to get it into core.
https://github.com/ZaengleCorp/Hacksaw-for-ExpressionEngine
|
|
|