>>>I have not used *safe* ever. But use *escape* this works for me.
On Wed, Oct 3, 2012 at 9:54 AM, Laxmikant Gurnalkar < laxmikant.gurnal...@gmail.com> wrote: > Hi, > I have not used *sace* ever. But use *escape* this works for me. > https://docs.djangoproject.com/en/1.0/ref/templates/builtins/#escape > > Cheers > *Laxmikant G.* > > > > On Wed, Oct 3, 2012 at 4:06 AM, Marc Serra <mad...@gmail.com> wrote: > >> Hi, i'm trying to output raw html content form the database on the >> website, so i use the safe filter on the variable. All html code is >> displayed correctly except the ampersand that are escaped ignoring the safe >> filter, or It seems to me. >> >> I also tried to use a templatetag with the mark_safe function with the >> same outcome. >> >> Here an example: >> >> Source in database: >> >> <object width="560" height="340"><param name="movie" >> value="http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1"></param><param >> name="allowFullScreen" value="true"></param><param name="allowscriptaccess" >> value="always"></param><embed >> src="http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1" >> type="application/x-shockwave-flash" allowscriptaccess="always" >> allowfullscreen="true" width="560" height="340"></embed></object> >> >> On template with |safe filter (notice "&" replacement with "&"): >> >> <object height="340" width="560"><param name="movie" >> value="http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1 >> <http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1>"><param >> name="allowFullScreen" value="true"><param name="allowscriptaccess" >> value="always"><embed >> src="http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1 >> <http://www.youtube.com/v/Uq8zzBW9hlc&hl=en&fs=1&hd=1>" >> type="application/x-shockwave-flash" allowscriptaccess="always" >> allowfullscreen="true" height="340" width="560"></object> >> >> You know what can be the reason to this behaviour and how to solve it? >> >> Thank you, >> Marc Serra >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/M3FV3yY7JnoJ. >> To post to this group, send email to django-users@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. >> > > > > -- > * > > GlxGuru > > * > -- * GlxGuru * -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.