Opened 8 years ago

Closed 8 years ago

#4560 closed (duplicate)

When concatenating |linebreaks|truncatewords the paragraph is not closed

Reported by: rif <fericean@…> Owned by: adrian
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: UI/UX:


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 8 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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