Re: templates and html escaping

2006-03-27 Thread Arthur
> > I've thought about this a bit more; lots of good points have been > > raised. What I'd like to do would be to add a new tag that takes > > care of auto-escaping variables used within it. Something like:: > > > > {% autoescape %} > > Any {{ variables }} used within this {{ block }

Re: templates and html escaping

2006-03-03 Thread Christopher Lenz
Am 03.03.2006 um 18:53 schrieb Jacob Kaplan-Moss: > Hey folks -- > > I've thought about this a bit more; lots of good points have been > raised. What I'd like to do would be to add a new tag that takes > care of auto-escaping variables used within it. Something like:: > > {% autoescape %}

Re: templates and html escaping

2006-03-03 Thread Julio Nobrega
Sounds good, but I just don't like the name. How about "escape", or "escapeblock"? And how about... {% autoescape except "br,p,table" %} ? On 3/3/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > Hey folks -- > > I've thought about this a bit more; lots of good points have been > rais

Re: templates and html escaping

2006-03-03 Thread [EMAIL PROTECTED]
Max Battcher wrote: > > the standard solution is to use a wrapper for strings that you > > *don't* want escaped. see e.g. the section on "HTML templates" > > on this page: > > The other problem is that not everyone wants the same escape. For > instance, there are those of us that {% load markup

Re: templates and html escaping

2006-03-03 Thread Jacob Kaplan-Moss
Hey folks -- I've thought about this a bit more; lots of good points have been raised. What I'd like to do would be to add a new tag that takes care of auto-escaping variables used within it. Something like:: {% autoescape %} Any {{ variables }} used within this {{ block }}

Re: templates and html escaping

2006-03-03 Thread gabor
Max Battcher wrote: > On 3/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Jacob Kaplan-Moss wrote: >> >>> Why not do it for all variables? At times you want to pass chunks of >>> HTML into a template that get displayed raw. I don't think the >>> behavior you suggest should be default, but

Re: templates and html escaping

2006-03-03 Thread Max Battcher
On 3/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Jacob Kaplan-Moss wrote: > > > Why not do it for all variables? At times you want to pass chunks of > > HTML into a template that get displayed raw. I don't think the > > behavior you suggest should be default, but do you have any ideas

Re: templates and html escaping

2006-03-03 Thread [EMAIL PROTECTED]
Jacob Kaplan-Moss wrote: > Why not do it for all variables? At times you want to pass chunks of > HTML into a template that get displayed raw. I don't think the > behavior you suggest should be default, but do you have any ideas on > how to make it optional? the standard solution is to use a wr

Re: templates and html escaping

2006-03-03 Thread Michael Radziej
Jacob Kaplan-Moss wrote: > The problem in the admin was fixed in [1982]: http:// > code.djangoproject.com/changeset/1982; thanks (and sorry--I'll start using the svn then) > in your own templates you'll > want to use the "escape" filter (http://www.djangoproject.com/ > documentation/templates/#

Re: templates and html escaping

2006-03-03 Thread Gábor Farkas
Gábor Farkas wrote: > Jacob Kaplan-Moss wrote: >> On Mar 2, 2006, at 3:16 PM, Michael Radziej wrote: >>> Now, did I miss something and is this already fixed? Should this be >>> treated differently? How do other people handle this? >> >> The problem in the admin was fixed in [1982]: http:// >> cod

Re: templates and html escaping

2006-03-03 Thread Gábor Farkas
Jacob Kaplan-Moss wrote: > On Mar 2, 2006, at 3:16 PM, Michael Radziej wrote: >> Now, did I miss something and is this already fixed? Should this be >> treated differently? How do other people handle this? > > The problem in the admin was fixed in [1982]: http:// > code.djangoproject.com/changes

Re: templates and html escaping

2006-03-03 Thread Jacob Kaplan-Moss
On Mar 2, 2006, at 3:16 PM, Michael Radziej wrote: > Now, did I miss something and is this already fixed? Should this be > treated differently? How do other people handle this? The problem in the admin was fixed in [1982]: http:// code.djangoproject.com/changeset/1982; in your own templates you'

templates and html escaping

2006-03-02 Thread Michael Radziej
Hi, the behaviour of django for fields that contain html markup ("<" ...) is wrong, at least in version 0.91. First, the admin pages do not html escape these. There might be corner cases when this is intended, but it seems very dangerous. Second, regarding Template, I think the default not t