src/jquery-tokeninput/jquery-tokeninput.js
function highlight_term(value, term) {
          return value.replace(
            new RegExp(
              "(?![^&;]+;)(?!<[^<>]*)(" + regexp_escape(term) + ")(?![^<>]*>)(?![^&;]+;)",
              "gi"
            ), function(match, p1) {
              return "<b>" + escapeHTML(p1) + "</b>";
            }
          );
      }
function highlight_term(value, term) {
          return value.replace(
            new RegExp(
              "(?![^&;]+;)(?!<[^<>]*)(" + regexp_escape(term) + ")(?![^<>]*>)(?![^&;]+;)",
              "gi"
            ), function(match, p1) {
              return "<b>" + escapeHTML(p1) + "</b>";
            }
          );
      }
function highlight_term ( value , term ) { return value . replace ( new RegExp ( "(?![^&;]+;)(?!<[^<>]*)(" + regexp_escape ( term ) + ")(?![^<>]*>)(?![^&;]+;)" , "gi" ) , function ( match , p1 ) { return "<b>" + escapeHTML ( p1 ) + "</b>" ; } ) ; }
Highlight the query part of the search term
Highlight the query part of the search term