Search code examples
pythondjangotemplatesfrontendcss-hyphens

Filter safe does not work on the shy tag issue


I have a problem with breaking words in the right place at the Django template. Appears ­ I'm trying to filter safe, but it does not work.

Here is my code:

    <div class="my_class">
        <h3>{{ object.title|safe }}</h3>
    </div>

Solution

  • From the doc here:safe

    safe

    Marks a string as not requiring further HTML escaping prior to output. When autoescaping is off, this filter has no effect.

    And Django's templating engine does escaping automatically, look When should I use escape and safe in Django's template system?