Code

Opened 7 years ago

Closed 7 years ago

#3963 closed (wontfix)

[patch] Add optional replacement for truncate filters

Reported by: Johan Bergström <bugs@…> Owned by: adrian
Component: Template system Version: master
Severity: Keywords: truncate optional replacement
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This small patch adds support for an optional replacement when truncatewords or truncatewords_html is used. It defaults "..." for truncatewords, " ..." for truncatewords_html and returns input silently if comma should be used as a delimiter.

Attachments (3)

truncate_optional_replacement.patch (3.3 KB) - added by bugs@… 7 years ago.
truncate_optional_replacement_v2.patch (3.3 KB) - added by Johan Bergström <bugs@…> 7 years ago.
updated patch which fixes issues mentioned earlier
truncate_optional_replacement_v2_tests.patch (913 bytes) - added by Johan Bergström <bugs@…> 7 years ago.
test cases for latest patch (v2)

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by bugs@…

comment:1 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by Johan Bergström <bugs@…>

  • Patch needs improvement set

Please disregard this patch; i made a mistake and assumed that arg would be a string. Updated patch and test case will arrive shortly..

Changed 7 years ago by Johan Bergström <bugs@…>

updated patch which fixes issues mentioned earlier

Changed 7 years ago by Johan Bergström <bugs@…>

test cases for latest patch (v2)

comment:3 Changed 7 years ago by Johan Bergström <bugs@…>

  • Needs tests unset
  • Patch needs improvement unset

Updated properties to better reflect ticket status. Is there anything else that needs to be done here?

comment:4 Changed 7 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

I really can't see that is widely useful. If there is a realy big reason why a particular project cannot use three dots as the continuation marker, it's trivial to write a custom version of the truncatewords filter.

Addding endless customisation options might seem like an easy thing to do, but it increases the maintenance burden and isn't always really scratching more than just an isolated itch. I think in this case, it's not worth including.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.