#20624 closed Uncategorized (needsinfo)
Truncatechars add empty space char at the beginning of the string
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Template system | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi, I am using Dj 1.4.2 and I am having this is issue with truncate chars: when the value exceeds the char limit I set the result of truncating has a leading white space that wasn't there in the first place.
In the template:
<input type="hidden" id="donate_progetto" value="{{ progetto.denominazione|truncatechars:40 }}"/>
Output:
<input type="hidden" id="donate_progetto" value=" CORREGGIO. Torre Civica - Completame..."/>
If i remove runcatechars the result is the following
Output:
<input type="hidden" id="donate_progetto" value="CORREGGIO. Torre Civica - Completamento intervento di riparazione e consolidamento, successivo alla messa in sicurezza"/>
Change History (3)
comment:1 by , 12 years ago
Component: | Uncategorized → Template system |
---|---|
Resolution: | → needsinfo |
Status: | new → closed |
comment:2 by , 12 years ago
Thanks for the reply, I opened a new ticket with more info here : https://code.djangoproject.com/ticket/20626#ticket
comment:3 by , 12 years ago
Please don't create a new ticket, this makes it hard to track the conversation.
Instead, you can reopen this ticket (in the "Modify Ticket" tab).
Before reopening this one, could you isolate the problem a bit further?
Having a simple bit of code that demonstrates your issue will make a ticket get fixed much quicker.
Your project has a lot of code and is mostly written in a language I don't understand, which makes it hard to confirm if there really is a bug here.
For reference, here's the text of your other ticket that I closed:
This ticket is the continuation of: https://code.djangoproject.com/ticket/20624
As it was marked as needsinfo I add the following:
the source is available on GitHub here https://github.com/DeppSRL/open_ricostruzione
The template where the issue was happening is
on line 20
Thanks.
Hi,
I tried several versions of django (including 1.4.2) but could not reproduce your issue.
Here's the code I used:
This doesn't print any leading space.
I'm going to mark this ticket as
needsinfo
. Please reopen it with some additional information that could help us track down the issue (in particular, isprogetto.denominazione
some kind of special object?).Thanks