Opened 7 years ago

Closed 7 years ago

#25529 closed New feature (worksforme)

Avoid non-breaking spaces between values and units when using filters in plain text templates

Reported by: Mike Owned by: nobody
Component: Template system Version: 1.8
Severity: Normal Keywords: filters
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

#20246 added \xa0 characters between numbers and units in various filters like timesince.

This means you can't easily use these filters in templates that generate plain text content, e.g. text that you want to send to another service as part of handling a request.

We need a way to turn off those non-breaking spaces in the filters that use them.

Change History (3)

comment:1 Changed 7 years ago by Mike

Summary: Cannot use filters for plain text templates due to non-breaking spaces between values and unitsAvoid non-breaking spaces between values and units when using filters in plain text templates

comment:2 Changed 7 years ago by Claude Paroz

Sorry, but it's not very clear to me why you couldn't have non-breaking spaces in plain text. Could you elaborate a bit?

comment:3 Changed 7 years ago by Claude Paroz

Resolution: worksforme
Status: newclosed

Please reopen if you can show your issue corresponds to a common use case. Otherwise, I think it wouldn't be hard to create your own template filter (to_ascii?) and chain with the appropriate filters (might also be implemented by a custom response middleware).

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