title: Customising the output of items using django-autocomplete-light v3
body: <p>In earlier versions of django-autocomplete-light you could use a template to render each returned entry, which included the ability to insert custom HTML </p>
  
  <p>I can't figure out how to do that using the regular API, so I'm trying to add it in.</p>
  
  <p>So far I have a class like this which uses <code>mark_safe</code> and the HTML is being passed through:</p>
  
  <pre><code>class TemplateRenderSelect2QuerySetView(autocomplete.Select2QuerySetView):
      def get_result_label(self, result):
          """Return the label of a result."""
          template = get_template("autocomplete_light/item.html")
  
          context = Context({"item": result})
          return mark_safe(template.render(context))
  </code></pre>
  
  <p>And the template <code>autocomplete_light/item.html</code> is:</p>
  
  <pre><code>&lt;b&gt;{{ item.name }}&lt;/b&gt;
  </code></pre>
  
  <p>But thats being rendered as:</p>
  
  <p><a href="https://i.stack.imgur.com/OJv8e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OJv8e.png" alt="enter image description here"></a></p>
  
  <p>But the JSON is correct with the right tags:</p>
  
  <pre><code>{"pagination": {"more": false}, "results": [{"text": "&lt;b&gt;Victoria&lt;/b&gt;", "id": 11}]}
  </code></pre>
  
  <p>How can I get django-admin to render the HTML properly?</p>
  
  <hr>
  
  <p>edit: I found some <a href="http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html?highlight=data-html#displaying-results-using-custom-html" rel="nofollow noreferrer">extra documentation</a> on custom HTML and tried setting <code>attrs={'data-html': 'true'}</code> against the widget, but its still not working</p>