1define([], function () { 2 return { 3 getNoResultHtml: function ({html}) { 4 return html`<p>${algoliaConfig.translations.noResults}</p>`; 5 }, 6 7 getHeaderHtml: function ({section}) { 8 return section.label; 9 }, 10 11 getItemHtml: function ({item, components, html}) { 12 return html`<a class="algoliasearch-autocomplete-hit" 13 href="${item.url}" 14 data-objectId="${item.objectID}" 15 data-position="${item.position}" 16 data-index="${item.__autocomplete_indexName}" 17 data-queryId="${item.__autocomplete_queryID}"> 18 <div class="info-without-thumb"> 19 ${this.safeHighlight(components, item, "name")} 20 <div class="details"> 21 ${this.safeHighlight(components, item, "content")} 22 </div> 23 </div> 24 <div class="algolia-clearfix"></div> 25 </a>`; 26 }, 27 28 getFooterHtml: function () { 29 return ""; 30 }, 31 32 safeHighlight: function(components, hit, attribute) { 33 const highlightResult = hit._highlightResult[attribute]; 34 35 if (!highlightResult) return ''; 36 37 try { 38 return components.Highlight({ hit, attribute }); 39 } catch (e) { 40 return ''; 41 } 42 } 43 44 }; 45});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.