Opened 10 years ago
Closed 10 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 by , 10 years ago
| Summary: | Cannot use filters for plain text templates due to non-breaking spaces between values and units → Avoid non-breaking spaces between values and units when using filters in plain text templates |
|---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
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).
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?