Opened 18 years ago
Closed 18 years ago
#4560 closed (duplicate)
When concatenating |linebreaks|truncatewords the paragraph is not closed
Description ¶
If I filter some field in a template e.g. {{news.description|linebreaks|truncatewords:"10"}} the resulting html code has a <p> that does not have the corresponding </p>.
If I use any of these two filters alone the result is correct but when used together the described erratic behavior occurs.
Workaround: {{news.description|linebreaks|truncatewords:"10"}}</p>
Note:
See TracTickets
for help on using tickets.
truncatewords
is not supposed to be an html aware filter.The workaround is actually
{{news.description|linebreaks|truncatewords_html:"10"}}
Alternately, you can (or will be able to) use
truncatewords
beforelinebreaks
- that requires #4655 to be applied first. So I'll mark as a dupe of that one.