How to prevent Django's label_tag function from escaping the label?
<p>Example:</p>

<pre><code>&gt;&gt;&gt; example.label
&amp;#x3bb;&lt;sub&gt;blabla&lt;/sub&gt;
&gt;&gt;&gt; example.label_tag()
[...]&amp;amp;#x3bb;&amp;lt;blabla&amp;gt;[...]
</code></pre>

<p>Even calling <code>mark_safe(example.label)</code> before <code>label_tag()</code> does not prevent Django from escaping the HTML. How can I get <code>label_tag()</code> to return unescaped labels?</p>

<p>There is a comment in the <a href="https://github.com/django/django/blob/2ced2f785d5aca0354abf5841d5449b7a49509dc/django/forms/boundfield.py#L135" rel="nofollow">code for <code>label_tag</code></a></p>

<pre><code>Wraps the given contents in a &lt;label&gt;, if the field has an ID attribute.
contents should be 'mark_safe'd to avoid HTML escaping. If contents
aren't given, uses the field's HTML-escaped label.
</code></pre>

<p>So </p>

<pre><code>example.label_tag(contents=mark_safe(example.label))
</code></pre>

<p>Should work.. I can't see another way around this problem</p>

python django