On Jan 1, 2018 2:29 PM, "Malik Rumi" <malik.a.rumi@gmail.com> wrote:
Well, as I said at the beginning, I don't seem to 'get' autoescape and safe. For example, I put this in my template:{{ object.content|linebreaks|safe }}But the result in my web page is:<p>Friday, November 17, 2017<br>
Have you verified that object.content contains un-escaped (raw) HTML? Is it possible that the steering is being escaped before it is saved?
What is the raw output from object.content in the shell?
Is content a real field on the model it is it a property or method that potentially returns pre-escaped HTML? You may be marking the strings as safe, but it appears that they may already be escaped before they hit the template.
-James
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciUj0BkpqeqH%3Diaovsruftx%2BBK0mYhco1XW%3DMTxSZamV8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment