Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
candidates = candidates.map(function (hint) {
var index = hint.indexOf(lowerCaseQuery),
$hintObj = $('<span>'),
slugs = webfont.searchBySlug(hint);
// load the matching font scripts individually for cachability
slugs.forEach(function (slug) {
var font = webfont.getFontBySlug(slug),
script;
if (!(scriptCache.hasOwnProperty(slug)) && window.navigator.onLine) {
script = webfont.createInclude([font]);
$(script).appendTo("head");
scriptCache[slug] = true;
}
});
var fontNameSpan = $('<span class="ewf-fontname">');
// emphasize the matching substring
if (index >= 0) {</span></span>