Opened 13 years ago

Closed 13 years ago

#4560 closed (duplicate)

When concatenating |linebreaks|truncatewords the paragraph is not closed

Reported by: rif <fericean@…> Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: Keywords: linebreaks truncatewords paragraph
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


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>

Change History (1)

comment:1 Changed 13 years ago by Chris Beaven

Resolution: duplicate
Status: newclosed

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 before linebreaks - that requires #4655 to be applied first. So I'll mark as a dupe of that one.

Note: See TracTickets for help on using tickets.
Back to Top