TopShelfCraft / Wordsmith

A plugin for Craft CMS to help you manage and manipulate text.
Other
30 stars 20 forks source link

chop filter - opening HTML tag length is counted along with text length #24

Open piotrpog opened 5 years ago

piotrpog commented 5 years ago

I noticed that when I use allowedTags option, with chop filter (while chopping by a number of characters), opening tag length in the text is counted along with text length. But when this specific allowed tag is automatically closed, this closing tag length is not counted.

I think it would be best if these tags length would be no counted at all, after all, we truncate text to specific length showed to the user, it does not matter how long HTML is.

toddpadwick commented 5 years ago

This would be a great improvement - I have a bio description which the client can add links to. It needs to be visually truncated to 180 chars however when they add a link to it, the length of the link is counted and if the URL is long it can leave only a word or two rendered on the front end.