Re: preventing template from converting html entities
Hey sorry guys, i couldn't find this post anymore! Thanks for the answers but i've found the resolution to my problem in the documentation, i just forgot in the beginning where it says about {% autoescape off %} This is the tag to use to prevent the template system from converting in " Example: Test Becomes Test Causing serious problems on some browsers, cos the html is not valid. While {% autoescape off %}Test{% endautoescape %} will output correctly Test. Didn't try force_escape, but that sounds the opposite of what I want to do.. Thanks. PS: Django is great, no doubt the best framework I ever used. On Feb 25, 3:35 pm, Alex Robbinswrote: > Oops, it would actually be > title={% filter force_escape %}{{ villa.name }}{% endfilter %} > > Sorry. > -- > Alex Robbins > 5Q Communications, Inc.http://www.5Qcommunications.com/ > alex.robb...@5qcommunications.com > 800-747-4214 ext 913 (p)http://www.ask5q.com/twitter/ > > On Thu, Feb 25, 2010 at 8:33 AM, Alex Robbins > > > > wrote: > > I think you can do that with title={% filter force_escape > > %}"{{ villa.name }}"{% endfilter %}. Haven't tried it though. > > > Alex > > > On Feb 24, 8:36 am, Federico Capoano wrote: > >> Hello to all, > > >> simple question: > > >> I have the following HTML in a template: > >> > > >> But it gets rendered this way: > >> > > >> That is, the entity is converted to the respective character, > >> ". Very nice, but i'd need > > >> Is there a filter or something i can use to tell the Django Template > >> System to render ? > > >> Thanks in advance. > > >> Federico > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: preventing template from converting html entities
Oops, it would actually be title={% filter force_escape %}{{ villa.name }}{% endfilter %} Sorry. -- Alex Robbins 5Q Communications, Inc. http://www.5Qcommunications.com/ alex.robb...@5qcommunications.com 800-747-4214 ext 913 (p) http://www.ask5q.com/twitter/ On Thu, Feb 25, 2010 at 8:33 AM, Alex Robbinswrote: > I think you can do that with title={% filter force_escape > %}"{{ villa.name }}"{% endfilter %}. Haven't tried it though. > > Alex > > On Feb 24, 8:36 am, Federico Capoano wrote: >> Hello to all, >> >> simple question: >> >> I have the following HTML in a template: >> >> >> But it gets rendered this way: >> >> >> That is, the entity is converted to the respective character, >> ". Very nice, but i'd need >> >> Is there a filter or something i can use to tell the Django Template >> System to render ? >> >> Thanks in advance. >> >> Federico > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: preventing template from converting html entities
I think you can do that with title={% filter force_escape %}"{{ villa.name }}"{% endfilter %}. Haven't tried it though. Alex On Feb 24, 8:36 am, Federico Capoanowrote: > Hello to all, > > simple question: > > I have the following HTML in a template: > > > But it gets rendered this way: > > > That is, the entity is converted to the respective character, > ". Very nice, but i'd need > > Is there a filter or something i can use to tell the Django Template > System to render ? > > Thanks in advance. > > Federico -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: preventing template from converting html entities
On Feb 24, 2:36 pm, Federico Capoanowrote: > Hello to all, > > simple question: > > I have the following HTML in a template: > > > But it gets rendered this way: > > > That is, the entity is converted to the respective character, > ". Very nice, but i'd need > > Is there a filter or something i can use to tell the Django Template > System to render ? > > Thanks in advance. > > Federico If I've understood you correctly, it's not the templating system that is converting it, but the browser. When a browser sees it will print ". To prevent this, you'll need to double-escape it - ie replace the & with the encoded version, so you have quot; -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
preventing template from converting html entities
Hello to all, simple question: I have the following HTML in a template: But it gets rendered this way: That is, the entity is converted to the respective character, ". Very nice, but i'd need Is there a filter or something i can use to tell the Django Template System to render ? Thanks in advance. Federico -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.