[autocomplete] add option to allow HTML in label

[autocomplete] add option to allow HTML in label

I spend the last two days changing all 4 different types of fancy list controls and autocomplete functions we use to jQuery UI's autocomplete! I love that there is 1 out of the box solution for so many different situations!

The main thing I've been missing is an option that allows me to format the label used by the widget.

I have read that I can override the renderitem method, but this seems like a very very complicated solution to a very simple problem.

The render item function currently is:
  1.     _renderItem: function( ul, item ) {
  2.         return $( "<li>" )
  3.             .append( $( "<a>" ).text( item.label ) )
  4.             .appendTo( ul );
  5.     },
what if we would
- add an option allowHTML

and change the code to:
  1.     _renderItem: function( ul, item ) {

  2.       if ( this.options.allowHTML  == true ) {
  3.             return $( "<li>" )
  4.                   .append( $( "<a>" ).html( item.label ) )
  5.                   .appendTo( ul );
  6.       }else{
  7.             return $( "<li>" )
  8.                   .append( $( "<a>" ).text( item.label ) )
  9.                   .appendTo( ul );
  10.       }


  11.     },





It's a simple addition, allowing 'simple' users full control over the format of the label without destroying compatibility...